pub trait SyntaxKind:
Copy
+ Eq
+ Send {
// Required methods
fn is_trivia(&self) -> bool;
fn is_comment(&self) -> bool;
fn is_whitespace(&self) -> bool;
fn is_token_type(&self) -> bool;
fn is_element_type(&self) -> bool;
}Expand description
Syntax kind definitions for tokens and nodes in the parsing system.
This module provides the SyntaxKind trait which serves as the foundation
for defining different types of tokens and nodes in the parsing system.
It enables categorization of kind elements and provides methods for
identifying their roles in the language grammar.
Required Methods§
Sourcefn is_trivia(&self) -> bool
fn is_trivia(&self) -> bool
Returns true if this kind represents trivia (whitespace, comments, etc.).
Trivia tokens are typically ignored during parsing but preserved for formatting and tooling purposes.
Sourcefn is_comment(&self) -> bool
fn is_comment(&self) -> bool
Sourcefn is_whitespace(&self) -> bool
fn is_whitespace(&self) -> bool
Returns true if this kind represents whitespace.
Sourcefn is_token_type(&self) -> bool
fn is_token_type(&self) -> bool
Sourcefn is_element_type(&self) -> bool
fn is_element_type(&self) -> bool
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.