Skip to main content

AstNode

Trait AstNode 

Source
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§

Source

fn can_cast(kind: SyntaxKind) -> bool
where Self: Sized,

Source

fn cast(node: SyntaxNode) -> Option<Self>
where Self: Sized,

Source

fn syntax(&self) -> &SyntaxNode

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§