Expand description
Represents the tokens of the s-expressions. An s-expression may be a list of symbols and other s-expressions or a symbol.
Variants
Symbol(String)
List(Vec<Token>)
Implementations
sourceimpl Token
impl Token
sourcepub fn symbol(self) -> Option<String>
pub fn symbol(self) -> Option<String>
If the token is a Symbol
, returns an Option
, containing the symbol name.
Else returns None
.
pub fn symbol_ref(&self) -> Option<&String>
sourcepub fn list(self) -> Option<Vec<Token>>
pub fn list(self) -> Option<Vec<Token>>
If the token is a List
, returns an Option
, containing the elements.
Else returns None
.
pub fn list_ref(&self) -> Option<&Vec<Token>>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
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