pub trait TypedSyntaxNode {
type StablePtr: TypedStablePtr;
type Green;
const OPTIONAL_KIND: Option<SyntaxKind>;
// Required methods
fn missing(db: &dyn SyntaxGroup) -> Self::Green;
fn from_syntax_node(db: &dyn SyntaxGroup, node: SyntaxNode) -> Self;
fn as_syntax_node(&self) -> SyntaxNode;
fn stable_ptr(&self) -> Self::StablePtr;
}
Expand description
Trait for the typed view of the syntax tree. All the internal node implementations are under the ast module.
Required Associated Constants§
Sourceconst OPTIONAL_KIND: Option<SyntaxKind>
const OPTIONAL_KIND: Option<SyntaxKind>
The relevant SyntaxKind. None for enums.
Required Associated Types§
type StablePtr: TypedStablePtr
type Green
Required Methods§
fn missing(db: &dyn SyntaxGroup) -> Self::Green
fn from_syntax_node(db: &dyn SyntaxGroup, node: SyntaxNode) -> Self
fn as_syntax_node(&self) -> SyntaxNode
fn stable_ptr(&self) -> Self::StablePtr
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.