macro_rules! declare_plugin {
($plugin:ident, $id:expr, [ $( $node:ident ),+ $(,)? ]) => { ... };
($plugin:ident, $id:expr, [ $( $node:ident ),+ $(,)? ], install = |$reg:ident| $body:block) => { ... };
}Expand description
Declare a plugin struct that installs a set of node descriptors and handlers
in one shot. Each entry should correspond to a #[node]-annotated
function name in scope so <name>_descriptor and <name>_handler exist.
ⓘ
use daedalus_nodes::declare_plugin;
use daedalus_macros::node;
#[node(id = "demo:noop", inputs("in"), outputs("out"))]
fn noop(value: i64) -> Result<i64, daedalus_runtime::NodeError> {
Ok(value)
}
declare_plugin!(DemoPlugin, "demo", [noop]);