pub struct Token {
pub kind: TokenKind,
pub span: ByteSpan,
}Expand description
One lexical token: its classified/decoded content plus the exact source-byte span it was scanned from.
The span is load-bearing (see module docs); Token::lexeme
recovers the raw source bytes.
Fields§
§kind: TokenKindClassified/decoded content of the token.
span: ByteSpanExact source bytes this token was scanned from.
Implementations§
Trait Implementations§
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Forget for Token
impl Freeze for Token
impl Move 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