pub struct Token<'s> {
pub kind: TokenKind<'s>,
pub range: SourceRange,
pub leading_trivia: (),
pub tailing_trivia: (),
}Fields§
§kind: TokenKind<'s>§range: SourceRange§leading_trivia: ()§tailing_trivia: ()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§
Source§impl Location for Token<'_>
impl Location for Token<'_>
Source§fn current_token_start(&self) -> usize
fn current_token_start(&self) -> usize
Current token’s start offset
Source§fn previous_token_end(&self) -> usize
fn previous_token_end(&self) -> usize
Previous token’s end offset
Auto Trait Implementations§
impl<'s> Freeze for Token<'s>
impl<'s> RefUnwindSafe for Token<'s>
impl<'s> Send for Token<'s>
impl<'s> Sync for Token<'s>
impl<'s> Unpin for Token<'s>
impl<'s> UnsafeUnpin for Token<'s>
impl<'s> UnwindSafe for Token<'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