pub trait AstNode<'a>: Sized {
// Required methods
fn from_untyped(node: &'a SyntaxNode) -> Option<Self>;
fn to_untyped(&self) -> &'a SyntaxNode;
// Provided methods
fn span(&self) -> Span { ... }
fn to_text(&self) -> EcoString { ... }
fn cast<T: AstNode<'a>>(&self) -> Option<T> { ... }
}
Required Methods§
fn from_untyped(node: &'a SyntaxNode) -> Option<Self>
fn to_untyped(&self) -> &'a SyntaxNode
Provided Methods§
fn span(&self) -> Span
fn to_text(&self) -> EcoString
fn cast<T: AstNode<'a>>(&self) -> Option<T>
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.