#[non_exhaustive]pub enum TokenKind {
Show 14 variants
Keyword,
Type,
Function,
String,
Number,
Comment,
Operator,
Punctuation,
Variable,
Constant,
Tag,
Attribute,
Escape,
Plain,
}Expand description
Classifies a token span into a stable highlighting category.
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
Matches language keywords and storage scopes.
Type
Matches named types and type-like support scopes.
Function
Matches function and method names.
String
Matches string literal content.
Number
Matches numeric literals.
Comment
Matches comment text.
Operator
Matches operator scopes before generic keywords.
Punctuation
Matches punctuation and delimiter scopes.
Variable
Matches variable-like scopes.
Constant
Matches non-numeric constant scopes.
Tag
Matches tag names such as HTML elements.
Attribute
Matches attribute and property names.
Escape
Matches escape sequences inside literals.
Plain
Fallback when no supported scope prefix matches.
Trait Implementations§
impl Copy for TokenKind
impl Eq for TokenKind
impl StructuralPartialEq for TokenKind
Auto Trait Implementations§
impl Freeze for TokenKind
impl RefUnwindSafe for TokenKind
impl Send for TokenKind
impl Sync for TokenKind
impl Unpin for TokenKind
impl UnsafeUnpin for TokenKind
impl UnwindSafe for TokenKind
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,
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.