Struct ra_ap_mbe::DeclarativeMacro
source · [−]pub struct DeclarativeMacro { /* private fields */ }Expand description
This struct contains AST for a single macro_rules definition. What might
be very confusing is that AST has almost exactly the same shape as
tt::TokenTree, but there’s a crucial difference: in macro rules, $ident
and $()* have special meaning (see Var and Repeat data structures)
Implementations
sourceimpl DeclarativeMacro
impl DeclarativeMacro
sourcepub fn parse_macro_rules(tt: &Subtree) -> Result<DeclarativeMacro, ParseError>
pub fn parse_macro_rules(tt: &Subtree) -> Result<DeclarativeMacro, ParseError>
The old, macro_rules! m {} flavor.
sourcepub fn parse_macro2(tt: &Subtree) -> Result<DeclarativeMacro, ParseError>
pub fn parse_macro2(tt: &Subtree) -> Result<DeclarativeMacro, ParseError>
The new, unstable macro m {} flavor.
pub fn expand(&self, tt: &Subtree) -> ExpandResult<Subtree>
pub fn map_id_down(&self, id: TokenId) -> TokenId
pub fn map_id_up(&self, id: TokenId) -> (TokenId, Origin)
pub fn shift(&self) -> Shift
Trait Implementations
sourceimpl Clone for DeclarativeMacro
impl Clone for DeclarativeMacro
sourcefn clone(&self) -> DeclarativeMacro
fn clone(&self) -> DeclarativeMacro
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for DeclarativeMacro
impl Debug for DeclarativeMacro
sourceimpl PartialEq<DeclarativeMacro> for DeclarativeMacro
impl PartialEq<DeclarativeMacro> for DeclarativeMacro
sourcefn eq(&self, other: &DeclarativeMacro) -> bool
fn eq(&self, other: &DeclarativeMacro) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
impl Eq for DeclarativeMacro
impl StructuralEq for DeclarativeMacro
impl StructuralPartialEq for DeclarativeMacro
Auto Trait Implementations
impl RefUnwindSafe for DeclarativeMacro
impl Send for DeclarativeMacro
impl Sync for DeclarativeMacro
impl Unpin for DeclarativeMacro
impl UnwindSafe for DeclarativeMacro
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key and return true if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more