pub struct MetadataRecorder<const MAX_NODES: usize = DEFAULT_MAX_METADATA_NODES, const MAX_ENTITIES: usize = DEFAULT_MAX_METADATA_ENTITIES, const MAX_CALLBACKS: usize = DEFAULT_MAX_METADATA_CALLBACKS> { /* private fields */ }Expand description
In-memory metadata sink used by host discovery. It never opens transport.
Implementations§
Source§impl<const MAX_NODES: usize, const MAX_ENTITIES: usize, const MAX_CALLBACKS: usize> MetadataRecorder<MAX_NODES, MAX_ENTITIES, MAX_CALLBACKS>
impl<const MAX_NODES: usize, const MAX_ENTITIES: usize, const MAX_CALLBACKS: usize> MetadataRecorder<MAX_NODES, MAX_ENTITIES, MAX_CALLBACKS>
Sourcepub fn nodes(&self) -> &[NodeMetadata]
pub fn nodes(&self) -> &[NodeMetadata]
Recorded nodes in declaration order.
Sourcepub fn entities(&self) -> &[EntityMetadata]
pub fn entities(&self) -> &[EntityMetadata]
Recorded entities in declaration order.
Sourcepub fn callback_effects(&self) -> &[CallbackEffectMetadata]
pub fn callback_effects(&self) -> &[CallbackEffectMetadata]
Recorded optional callback effects in declaration order.
Sourcepub fn to_source_metadata_json(
&self,
export: &SourceMetadataExport<'_>,
) -> Result<StdString, Error>
pub fn to_source_metadata_json( &self, export: &SourceMetadataExport<'_>, ) -> Result<StdString, Error>
Emit schema-version-1 source metadata JSON without opening transport.
Sourcepub fn write_source_metadata_json(
&self,
export: &SourceMetadataExport<'_>,
out: &mut impl Write,
) -> Result
pub fn write_source_metadata_json( &self, export: &SourceMetadataExport<'_>, out: &mut impl Write, ) -> Result
Write schema-version-1 source metadata JSON without opening transport.
Sourcepub fn push_node(
&mut self,
id: NodeId<'_>,
name: &str,
namespace: &str,
domain_id: u32,
) -> Result<(), NodeMetadataError>
pub fn push_node( &mut self, id: NodeId<'_>, name: &str, namespace: &str, domain_id: u32, ) -> Result<(), NodeMetadataError>
Record a node.
phase-308 — pub because the recorder is the ONE recorder: the Rust
adapter (a NodeContext sink) and the C/C++ adapter (a recording RMW
backend + the timer/guard hooks in nros-cpp) both feed it, so there is
one definition of what a slot is and one schema emitter. Only the
adapter is per-language. Not a general-purpose API — it exists for
metadata-mode adapters, and misuse produces a sidecar that lies about
what the component declares.
Sourcepub fn push_entity(
&mut self,
entity: EntityMetadata,
) -> Result<(), NodeMetadataError>
pub fn push_entity( &mut self, entity: EntityMetadata, ) -> Result<(), NodeMetadataError>
Record an entity against an already-recorded node. See push_node
for why this is public.