pub struct NodeRegistration {
pub signatures: fn() -> &'static [FuncSig],
pub build: NodeBuildFn,
pub validate: Option<NodeValidator>,
}Expand description
A node module’s registration: signatures + builder.
Each node module submits one of these at link time via inventory::submit!.
The runtime collects all submissions to build the function registry and
dispatch table without any explicit module list.
Fields§
§signatures: fn() -> &'static [FuncSig]Returns the static slice of FuncSig entries for this module.
build: NodeBuildFnAttempts to build a node for the given function name.
Returns None if the name is not handled by this module,
or Some(Ok(node)) / Some(Err(msg)) if it is.
wire_types[i] is the resolved crate::ast::PortType of
wires[i] — the output type of the upstream node feeding
that wire input. Modules that build type-polymorphic nodes
(e.g. log_info, whose output type equals its input type)
read this to construct the node with the correct port
types. Modules whose nodes have type-fixed signatures can
ignore the slice. When the assembler can’t resolve a
wire’s type (forward reference, dangling), the slot
defaults to crate::ast::PortType::U64.
validate: Option<NodeValidator>Optional assembly-time validator for this module’s constants.
The factory calls this before build whenever the name
matches one of this module’s functions. Returning Err makes
the compile fail with a structured bad constant error, so
the node itself never sees a malformed literal and can keep
its constructor and eval() branch-free. See SRD 15 §“Const
Constraint Metadata” for the contract.
Trait Implementations§
impl Collect for NodeRegistration
Auto Trait Implementations§
impl Freeze for NodeRegistration
impl RefUnwindSafe for NodeRegistration
impl Send for NodeRegistration
impl Sync for NodeRegistration
impl Unpin for NodeRegistration
impl UnsafeUnpin for NodeRegistration
impl UnwindSafe for NodeRegistration
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more