pub struct MacroRulesDef { /* private fields */ }Expand description
Parsed declarative macro_rules! definition ((pattern) => { template }; ...).
Implementations§
Source§impl MacroRulesDef
impl MacroRulesDef
Sourcepub fn expand(&self, call_inner_src: &str, crate_prefix: &str) -> Option<String>
pub fn expand(&self, call_inner_src: &str, crate_prefix: &str) -> Option<String>
Attempts to expand call_inner_src (the inner text of foo! { ... } / foo!(...)).
Sourcepub fn expand_with_spans(
&self,
call_inner_src: &str,
call_base_off: u32,
crate_prefix: &str,
spans_out: &mut Vec<ExpandedSpanMap>,
) -> Option<String>
pub fn expand_with_spans( &self, call_inner_src: &str, call_base_off: u32, crate_prefix: &str, spans_out: &mut Vec<ExpandedSpanMap>, ) -> Option<String>
Expands call_inner_src (starting at byte call_base_off in the enclosing file) and records
rigid byte-offset mappings for every transcribed metavariable fragment in spans_out.
Source§impl MacroRulesDef
impl MacroRulesDef
Sourcepub fn parse_body(raw_body: &str) -> Option<Self>
pub fn parse_body(raw_body: &str) -> Option<Self>
Parses a macro_rules! body ({ (pat) => { body }; ... } or bare (pat) => { body }; ...).
Trait Implementations§
Source§impl Clone for MacroRulesDef
impl Clone for MacroRulesDef
Auto Trait Implementations§
impl Forget for MacroRulesDef
impl Freeze for MacroRulesDef
impl Move for MacroRulesDef
impl RefUnwindSafe for MacroRulesDef
impl Send for MacroRulesDefwhere
RawVecInner: Send,
impl Sync for MacroRulesDefwhere
RawVecInner: Sync,
impl Unpin for MacroRulesDef
impl UnsafeUnpin for MacroRulesDef
impl UnwindSafe for MacroRulesDefwhere
RawVecInner: UnwindSafe,
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