pub struct Token<'text> {
pub text: &'text str,
pub token_type: TokenType,
pub location: SourceLocation,
}Expand description
A token from a body of text.
The lifetime parameter 'text refers to the lifetime
of the body of text that was tokenized, creating this token.
Fields§
§text: &'text strThe text of the token.
token_type: TokenTypeThe type of the token (Whitespace or Word).
location: SourceLocationThe location of the token in the source body of text.
Implementations§
Trait Implementations§
impl<'text> Copy for Token<'text>
impl<'text> StructuralPartialEq for Token<'text>
Auto Trait Implementations§
impl<'text> Freeze for Token<'text>
impl<'text> RefUnwindSafe for Token<'text>
impl<'text> Send for Token<'text>
impl<'text> Sync for Token<'text>
impl<'text> Unpin for Token<'text>
impl<'text> UnwindSafe for Token<'text>
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