MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / registry_expand

Function registry_expand

flow-derive/src/node.rs:30–44  ·  view source on GitHub ↗
(input: NodeDefine)

Source from the content-addressed store, hash-verified

28 }
29}
30pub fn registry_expand(input: NodeDefine) -> TokenStream {
31 let name = &input.name;
32 let ty = &input.ty;
33 quote! {
34 flow_rs::submit!(#name.to_owned(),
35 flow_rs::node::NodeSlice{
36 cons: Box::new(|name: String, args: &toml::value::Table| Box::new(<#ty>::new(name, args))),
37 info: flow_rs::node::NodeInfo {
38 inputs: <#ty>::inputs_name(),
39 outputs: <#ty>::outputs_name(),
40 }
41 }
42 );
43 }
44}
45
46pub fn expand(input: DeriveInput) -> TokenStream {
47 let ident = input.ident;

Callers 2

node_registerFunction · 0.70
resource_registerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected