Skip to main content

register_node

Macro register_node 

Source
macro_rules! register_node {
    ($node_type:ty) => { ... };
}
Expand description

Register a crate::node::NodeImpl type’s NodeDescriptor for discovery by a later wave’s consumer.

Wired into #[derive(Node)] (mecha10-macros) and crate::node_main!, so a node crate gets a registration attempt “for free” the moment it uses either – it only becomes a populated entry once that crate also fills in NodeImpl::CRATE_NAME (NODE_TYPE is already set by every built-in node). No-op (resolves to no registered_nodes entry) when T::CRATE_NAME is None – the node isn’t meant to be scaffolded via mecha10 add – or T::NODE_TYPE is None – it’s a custom/project-local node, which doesn’t need an entry in this registry at all (see NodeImpl::NODE_TAGS’s doc comment on how those are discovered instead).