pub struct Token {
pub kind: TokenKind,
pub text: String,
pub raw: Option<String>,
pub span: Span,
}Expand description
One token with its source span and payload text.
Fields§
§kind: TokenKind§text: StringThe source text of this token (numbers keep their spelling; strings keep their unescaped value; identifiers keep their name).
raw: Option<String>The exact characters between string quotes, before escape decoding. Other token kinds leave this unset. It is retained so source-language constructs such as f-string interpolations can recover expression spans without losing provenance during preprocessing.
span: SpanTrait Implementations§
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