pub struct Token {
pub kind: TokenKind,
pub start: usize,
pub len: usize,
}
Expand description
The struct to represent a token.
Token contains the kind of token and the range of the token in the source. The range is represented by the start position and the length of the token.
Note!: This struct can live longer than the source string.
Fields§
§kind: TokenKind
The kind of the token.
start: usize
The start position of the token.
len: usize
The length of the token.
Implementations§
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 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