pub struct Token {
pub kind: TokenKind,
pub flags: TokenFlags,
pub value: u32,
pub span: Span,
}Expand description
One token, as the parser reads it.
Sixteen bytes, checked by a test below, and laid out the way PpToken is for the same
reason.
Fields§
§kind: TokenKindWhat it is.
flags: TokenFlagsWhether it started a line and whether anything came before it, carried through from the pp-token so that a diagnostic can say “did you mean to write this on its own line”.
value: u32The symbol for an identifier, the index into the matching vector of Tokens for a
constant or a literal, and zero for everything else.
span: SpanWhere it came from, which for a run of string literals covers the whole run.
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 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