pub struct Macro {
pub name: &'static str,
pub style: MacroStyle,
pub arg_count: ArgCount,
pub expander: MacroExpander,
pub description: Option<&'static str>,
}Expand description
Definition of a single macro.
Fields§
§name: &'static strThe macro name (e.g., “all”, “has”, “map”).
style: MacroStyleWhether this is a global or receiver-style macro.
arg_count: ArgCountThe expected argument count.
expander: MacroExpanderThe expansion function.
description: Option<&'static str>Optional description for documentation/IDE features.
Implementations§
Source§impl Macro
impl Macro
Sourcepub const fn new(
name: &'static str,
style: MacroStyle,
arg_count: ArgCount,
expander: MacroExpander,
) -> Self
pub const fn new( name: &'static str, style: MacroStyle, arg_count: ArgCount, expander: MacroExpander, ) -> Self
Create a new macro definition.
Sourcepub const fn with_description(
name: &'static str,
style: MacroStyle,
arg_count: ArgCount,
expander: MacroExpander,
description: &'static str,
) -> Self
pub const fn with_description( name: &'static str, style: MacroStyle, arg_count: ArgCount, expander: MacroExpander, description: &'static str, ) -> Self
Create a new macro definition with a description.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Macro
impl RefUnwindSafe for Macro
impl Send for Macro
impl Sync for Macro
impl Unpin for Macro
impl UnwindSafe for Macro
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more