pub struct Token(pub usize, pub Cow<'static, str>, pub usize);Expand description
Token value (lexeme).
The lexeme is stored as Cow<'static, str>: a keyword token whose source
spelling matches its canonical form exactly (e.g. SELECT) borrows the
associated &'static str from TokenType::as_str at zero cost, while
every other token (identifiers, literals, differently-cased keywords, …)
owns a freshly allocated String copied from the input.
Tuple Fields§
§0: usize§1: Cow<'static, str>§2: usizeImplementations§
Trait Implementations§
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