MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / plugin_const

Function plugin_const

wasm-pdk/macros/src/lib.rs:162–169  ·  view source on GitHub ↗
(_attr: TokenStream, item: TokenStream)

Source from the content-addressed store, hash-verified

160/// Exposes a zero-arg fn as a module constant via the `__const_<name>` export convention.
161#[proc_macro_attribute]
162pub fn plugin_const(_attr: TokenStream, item: TokenStream) -> TokenStream {
163 let mut input = parse_macro_input!(item as ItemFn);
164 if !input.sig.inputs.is_empty() {
165 return TokenStream::from(quote! { compile_error!("#[plugin_const] takes no parameters"); });
166 }
167 input.sig.ident = format_ident!("__const_{}", input.sig.ident);
168 plugin_fn(TokenStream::new(), TokenStream::from(quote!(#input)))
169}
170
171#[proc_macro_attribute]
172pub fn plugin_class(_attr: TokenStream, item: TokenStream) -> TokenStream {

Callers

nothing calls this directly

Calls 2

plugin_fnFunction · 0.85
is_emptyMethod · 0.45

Tested by

no test coverage detected