pub enum TokenKind {
Word,
QuotedIdentifier(String),
String {
value: String,
raw: bool,
quote: QuoteStyle,
},
Bytes {
value: Vec<u8>,
raw: bool,
quote: QuoteStyle,
},
Integer,
Float,
Parameter(String),
SystemVariable(String),
Punct(Punct),
Comment(CommentKind),
Whitespace,
}Expand description
What a token is.
Variants§
Word
An unquoted identifier or keyword: the parser decides which from context.
QuotedIdentifier(String)
A backtick-quoted identifier, with its decoded value (`a.b` is a.b).
String
A string literal with its decoded value.
Bytes
A bytes literal with its decoded value.
Integer
An integer literal (decimal or 0x hexadecimal) as written.
Float
A floating point literal as written.
Parameter(String)
@name, holding name.
SystemVariable(String)
@@name, holding name (dots included).
Punct(Punct)
Comment(CommentKind)
Whitespace
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TokenKind
impl<'de> Deserialize<'de> for TokenKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TokenKind
impl StructuralPartialEq for TokenKind
Auto Trait Implementations§
impl Forget for TokenKind
impl Freeze for TokenKind
impl Move for TokenKind
impl RefUnwindSafe for TokenKind
impl Send for TokenKindwhere
RawVecInner: Send,
impl Sync for TokenKindwhere
RawVecInner: Sync,
impl Unpin for TokenKind
impl UnsafeUnpin for TokenKind
impl UnwindSafe for TokenKindwhere
RawVecInner: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.