pub struct Token {
pub kind: TokenKind,
pub span: Span,
pub lexeme: String,
}Expand description
Token represents a single unit of meaning in a .tree.
A token has a kind, a span, and a lexeme. The kind is the type of the token, the span is the range in which a token appears in the original text, and the lexeme is the text that the token represents.
Fields§
§kind: TokenKindThe type of the token.
span: SpanThe range in which a token appears in the original text.
lexeme: StringThe literal characters that make up the token.
Trait Implementations§
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