pub struct Token {
pub kind: TokenType,
pub span: Span,
}Expand description
A lexical token, identifying its kind and span.
We define our own Token as the json_tools::Token defines a Buffer that can be heap allocated
or a Span. We only use the Span variant.
Our Token can also impl Copy and Clone as the size and semantics are acceptable.
Fields§
§kind: TokenTypeThe exact type of the token
span: SpanThe span allows to reference back into the source byte stream to obtain the string making up the token. Please note that for control characters, booleans and null (i.e
Trait Implementations§
Source§impl Ord for Token
impl Ord for Token
Source§impl PartialOrd for Token
impl PartialOrd for Token
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