pub trait AstNode: Sized {
// Required methods
fn cast(syntax: SyntaxNode) -> Option<Self>;
fn syntax(&self) -> &SyntaxNode;
}Expand description
A typed view over a SyntaxNode of a known kind.
Required Methods§
Sourcefn cast(syntax: SyntaxNode) -> Option<Self>
fn cast(syntax: SyntaxNode) -> Option<Self>
Wraps syntax if its kind matches this type; None otherwise.
Sourcefn syntax(&self) -> &SyntaxNode
fn syntax(&self) -> &SyntaxNode
The underlying untyped node.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".