pub enum TokenRef<'s> {
Owned(Box<Token<'s>>),
Borrowed(&'s Token<'s>),
}Variants§
Owned(Box<Token<'s>>)
A reference to a token that is owned by the parser.
Borrowed(&'s Token<'s>)
A reference to a token that is borrowed from the input.
Methods from Deref<Target = TokenKind<'s>>§
Sourcepub fn is_identifier(&self) -> bool
pub fn is_identifier(&self) -> bool
Returns true if the enum is TokenKind::Identifier otherwise false
Sourcepub fn is_ordinal(&self) -> bool
pub fn is_ordinal(&self) -> bool
Returns true if the enum is TokenKind::Ordinal otherwise false
Sourcepub fn is_interpolated_string(&self) -> bool
pub fn is_interpolated_string(&self) -> bool
Returns true if the enum is TokenKind::InterpolatedString otherwise false
Sourcepub fn is_operator(&self) -> bool
pub fn is_operator(&self) -> bool
Returns true if the enum is TokenKind::Operator otherwise false
Sourcepub fn is_keyword(&self) -> bool
pub fn is_keyword(&self) -> bool
Returns true if the enum is TokenKind::Keyword otherwise false
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Returns true if the enum is TokenKind::Unknown otherwise false
Trait Implementations§
Auto Trait Implementations§
impl<'s> Freeze for TokenRef<'s>
impl<'s> RefUnwindSafe for TokenRef<'s>
impl<'s> Send for TokenRef<'s>
impl<'s> Sync for TokenRef<'s>
impl<'s> Unpin for TokenRef<'s>
impl<'s> UnsafeUnpin for TokenRef<'s>
impl<'s> UnwindSafe for TokenRef<'s>
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