#[non_exhaustive]pub enum Class {
Show 15 variants
Keyword,
Ident,
Number,
String,
Char,
Byte,
Template,
Comment,
DocComment,
Attribute,
Macro,
Punctuation,
Operator,
Whitespace,
Error,
}Expand description
The class of a Token.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Keyword
A keyword, including true, false and self.
Ident
An identifier or label.
Number
A number literal.
String
A string or byte string literal.
Char
A character literal.
Byte
A byte literal.
Template
A template literal.
Comment
A comment which is not a doc comment.
DocComment
A doc comment.
Attribute
An attribute, from # to its closing bracket.
Macro
An identifier immediately followed by !.
Punctuation
Delimiters and separators.
Operator
Operators.
Whitespace
Whitespace.
Error
Text which could not be lexed.
Implementations§
Trait Implementations§
impl Copy for Class
impl Eq for Class
impl StructuralPartialEq for Class
Auto Trait Implementations§
impl Forget for Class
impl Freeze for Class
impl Move for Class
impl RefUnwindSafe for Class
impl Send for Class
impl Sync for Class
impl Unpin for Class
impl UnsafeUnpin for Class
impl UnwindSafe for Class
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.