proc_macro

Macro proc_macro 

Source
macro_rules! proc_macro {
    ($name:ident ->  use $func:ident) => { ... };
    ($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 function-like procedural macro from another module.

ยงUsage patterns:

  • Already in scope: proc_macro!(name -> function)
  • Module reference: proc_macro!(name -> module::function)
  • Nested modules: proc_macro!(name -> a::b::c::function)
  • Literal path: proc_macro!(name -> "path/to/file.rs"::function)
  • Crate-relative path: proc_macro!(name -> @"path/from/crate/root.rs"::function)

See: macros!