pub enum MacroToken {
Literal(TokenKind),
Var(String),
Repeat(Vec<MacroToken>),
Optional(Vec<MacroToken>),
Quote(Vec<MacroToken>),
Antiquote(String),
SpliceArray(String),
}Expand description
Token in macro pattern or template.
Variants§
Literal(TokenKind)
Literal token that must match exactly.
Var(String)
Variable (matches any expression).
Repeat(Vec<MacroToken>)
Repetition (zero or more of the sub-pattern).
Optional(Vec<MacroToken>)
Optional (zero or one of the sub-pattern).
Quote(Vec<MacroToken>)
Syntax quotation (`(expr)).
Antiquote(String)
Antiquotation splice ($x).
SpliceArray(String)
Array splice ($[x]*).
Trait Implementations§
Source§impl Clone for MacroToken
impl Clone for MacroToken
Source§fn clone(&self) -> MacroToken
fn clone(&self) -> MacroToken
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MacroToken
impl Debug for MacroToken
Source§impl Display for MacroToken
impl Display for MacroToken
Source§impl PartialEq for MacroToken
impl PartialEq for MacroToken
impl StructuralPartialEq for MacroToken
Auto Trait Implementations§
impl Freeze for MacroToken
impl RefUnwindSafe for MacroToken
impl Send for MacroToken
impl Sync for MacroToken
impl Unpin for MacroToken
impl UnsafeUnpin for MacroToken
impl UnwindSafe for MacroToken
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