macro_rules! attr_macro {
($name:ident -> $func:ident) => { ... };
($name:ident -> use $module:ident :: $func:ident) => { ... };
($name:ident -> mod $module:ident :: $func:ident) => { ... };
($name:ident -> $module:ident :: $func:ident) => { ... };
($name:ident -> use $($module:ident)::+ :: $func:ident) => { ... };
($name:ident -> mod $first:ident $(:: $rest:ident)+ :: $func:ident) => { ... };
($name:ident -> $first:ident $(:: $rest:ident)+ :: $func:ident) => { ... };
($name:ident -> $path:literal :: $func:ident) => { ... };
($name:ident -> @$path:literal :: $func:ident) => { ... };
}Expand description
Defines and delegates a attribute macro from another module.
ยงUsage patterns:
- Already in scope:
attr_macro!(name -> function) - Module reference:
attr_macro!(name -> module::function) - Nested modules:
attr_macro!(name -> a::b::c::function) - Literal path:
attr_macro!(name -> "path/to/file.rs"::function) - Crate-relative path:
attr_macro!(name -> @"path/from/crate/root.rs"::function)
See: macros!