pub trait NodeFactory: Send + Sync {
// Required methods
fn signatures(&self) -> Vec<FuncSig>;
fn build(
&self,
name: &str,
wire_count: usize,
consts: &[FactoryArg],
) -> Result<Box<dyn PolydatNode>, String>;
}Expand description
Trait for external node providers.
External crates implement this to contribute Polydat node functions.
Once registered on a PolydatRuntime, the factory’s nodes are
indistinguishable from built-in nodes: same registry, same
describe output, same category grouping, same type checking.
Required Methods§
Sourcefn signatures(&self) -> Vec<FuncSig>
fn signatures(&self) -> Vec<FuncSig>
Return signatures for all functions this factory provides.
Called once at registration time. The returned signatures are merged into the runtime’s unified registry.
Sourcefn build(
&self,
name: &str,
wire_count: usize,
consts: &[FactoryArg],
) -> Result<Box<dyn PolydatNode>, String>
fn build( &self, name: &str, wire_count: usize, consts: &[FactoryArg], ) -> Result<Box<dyn PolydatNode>, String>
Build a node by name with the given constant arguments.
Called by the compiler when assembling a kernel that references
one of this factory’s functions. wire_count is the number of
wire inputs at the call site.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".