pub trait AstNode<'a>: Sized {
// Required methods
fn from_untyped(node: &'a SyntaxNode) -> Option<Self>;
fn to_untyped(self) -> &'a SyntaxNode;
// Provided method
fn span(self) -> Span { ... }
}
Expand description
A typed AST node.
Required Methods§
sourcefn from_untyped(node: &'a SyntaxNode) -> Option<Self>
fn from_untyped(node: &'a SyntaxNode) -> Option<Self>
Convert a node into its typed variant.
sourcefn to_untyped(self) -> &'a SyntaxNode
fn to_untyped(self) -> &'a SyntaxNode
A reference to the underlying syntax node.
Provided Methods§
Object Safety§
This trait is not object safe.