pub enum Token {
Symbol(Box<str>),
List(Vec<Token>),
}Expand description
Represents the token lists.
Variants§
Symbol(Box<str>)
A symbol token represented by its name.
List(Vec<Token>)
A list token containing other tokens.
Implementations§
Source§impl Token
impl Token
Sourcepub fn symbol(self) -> Option<Box<str>>
pub fn symbol(self) -> Option<Box<str>>
If the token is a Symbol, returns an Option, containing the symbol name.
Else returns None.
Sourcepub fn symbol_ref(&self) -> Option<&str>
pub fn symbol_ref(&self) -> Option<&str>
Same as fn symbol, but returns a ref.
Trait Implementations§
impl Eq for Token
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
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