Skip to main content

register_nodes

Macro register_nodes 

Source
macro_rules! register_nodes {
    ($sigs:expr, $builder:expr) => { ... };
    ($sigs:expr, $builder:expr, $validator:expr) => { ... };
}
Expand description

Register a node module’s signatures and builder with the Polydat runtime.

Place this call at module scope in each node module. The inventory crate arranges for the registration to run before main so that registry() and build_node() see all entries.

Two forms:

  • register_nodes!(signatures, build_node) — no assembly-time validation. The builder is responsible for handling any bad input itself (usually by trusting the caller or panicking).
  • register_nodes!(signatures, build_node, validate_node) — the factory calls validate_node(name, consts) before build_node. Use this to declare ConstConstraint-style checks so constructors can stay infallible.