pub struct Token { /* private fields */ }Expand description
An immutable lexical token. Its lexeme stays in SourceText, avoiding
one allocation and reference-counted handle per scanner token.
Implementations§
Source§impl Token
impl Token
pub const fn new(kind: TokenKind, range: TextRange) -> Self
pub const fn missing(kind: TokenKind, range: TextRange) -> Self
pub const fn kind(&self) -> TokenKind
pub const fn syntax_kind(&self) -> SyntaxKind
pub const fn range(&self) -> TextRange
pub const fn is_missing(&self) -> bool
Trait Implementations§
impl Copy for Token
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 UnsafeUnpin 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