pub struct NodeRegistry { /* private fields */ }Expand description
A registry that maps node type keys (e.g., “image-compress”) to node processors.
Uses Box<dyn NodeProcessor> for dynamic dispatch – the registry
holds heterogeneous processor types behind a single trait object.
Implementations§
Source§impl NodeRegistry
impl NodeRegistry
Sourcepub fn register(&mut self, key: &str, processor: Box<dyn NodeProcessor>)
pub fn register(&mut self, key: &str, processor: Box<dyn NodeProcessor>)
Register a processor under a node type key.
The key should be the node type name (e.g., “image-compress”, “spreadsheet-clean”).
If a processor is already registered under this key, it will be replaced (last registration wins).
§Arguments
key— the node type key (e.g., “image-compress”)processor— the processor instance to register
Sourcepub fn resolve(
&self,
node_type: &str,
_params: &Map<String, Value>,
) -> Option<&dyn NodeProcessor>
pub fn resolve( &self, node_type: &str, _params: &Map<String, Value>, ) -> Option<&dyn NodeProcessor>
Look up the processor for a given node type.
Does a direct lookup by node_type key (e.g., “image-compress”).
§Arguments
node_type— the node’s type field (e.g., “image-compress”, “spreadsheet-clean”)_params— the node’s params map (reserved for future use)
§Returns
Some(&dyn NodeProcessor)— if a matching processor was foundNone— if no processor matches the key
Sourcepub fn catalog(&self) -> Vec<NodeMetadata>
pub fn catalog(&self) -> Vec<NodeMetadata>
Collect metadata from ALL registered processors into a catalog.
This returns a Vec<NodeMetadata> — one entry per registered processor.
The order is determined by the HashMap’s iteration order (not guaranteed,
but deterministic for a given build). The node_catalog() WASM function
sorts the output by node type for stable snapshots.