pub trait AstNode {
// Required methods
fn can_cast(kind: SyntaxKind) -> bool
where Self: Sized;
fn cast(node: SyntaxNode) -> Option<Self>
where Self: Sized;
fn syntax(&self) -> &SyntaxNode;
}Expand description
A typed view of a CST node of a particular kind.
Required Methods§
fn can_cast(kind: SyntaxKind) -> boolwhere
Self: Sized,
fn cast(node: SyntaxNode) -> Option<Self>where
Self: Sized,
fn syntax(&self) -> &SyntaxNode
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".