pub trait LuaAstNode {
Show 19 methods
// Required methods
fn syntax(&self) -> &LuaSyntaxNode;
fn can_cast(kind: LuaSyntaxKind) -> bool
where Self: Sized;
fn cast(syntax: LuaSyntaxNode) -> Option<Self>
where Self: Sized;
// Provided methods
fn child<N: LuaAstNode>(&self) -> Option<N> { ... }
fn token<N: LuaAstToken>(&self) -> Option<N> { ... }
fn token_by_kind(&self, kind: LuaTokenKind) -> Option<LuaGeneralToken> { ... }
fn tokens<N: LuaAstToken>(&self) -> LuaAstTokenChildren<N> ⓘ { ... }
fn children<N: LuaAstNode>(&self) -> LuaAstChildren<N> ⓘ { ... }
fn descendants<N: LuaAstNode>(&self) -> impl Iterator<Item = N> { ... }
fn walk_descendants<N: LuaAstNode>(
&self,
) -> impl Iterator<Item = WalkEvent<N>> { ... }
fn ancestors<N: LuaAstNode>(&self) -> impl Iterator<Item = N> { ... }
fn get_root(&self) -> LuaSyntaxNode { ... }
fn get_parent<N: LuaAstNode>(&self) -> Option<N> { ... }
fn get_position(&self) -> TextSize { ... }
fn get_range(&self) -> TextRange { ... }
fn get_syntax_id(&self) -> LuaSyntaxId { ... }
fn get_text(&self) -> String { ... }
fn dump(&self) -> String { ... }
fn to_ptr(&self) -> LuaAstPtr<Self>
where Self: Sized { ... }
}
Required Methods§
fn syntax(&self) -> &LuaSyntaxNode
fn can_cast(kind: LuaSyntaxKind) -> boolwhere
Self: Sized,
fn cast(syntax: LuaSyntaxNode) -> Option<Self>where
Self: Sized,
Provided Methods§
fn child<N: LuaAstNode>(&self) -> Option<N>
fn token<N: LuaAstToken>(&self) -> Option<N>
fn token_by_kind(&self, kind: LuaTokenKind) -> Option<LuaGeneralToken>
fn tokens<N: LuaAstToken>(&self) -> LuaAstTokenChildren<N> ⓘ
fn children<N: LuaAstNode>(&self) -> LuaAstChildren<N> ⓘ
fn descendants<N: LuaAstNode>(&self) -> impl Iterator<Item = N>
fn walk_descendants<N: LuaAstNode>(&self) -> impl Iterator<Item = WalkEvent<N>>
fn ancestors<N: LuaAstNode>(&self) -> impl Iterator<Item = N>
fn get_root(&self) -> LuaSyntaxNode
fn get_parent<N: LuaAstNode>(&self) -> Option<N>
fn get_position(&self) -> TextSize
fn get_range(&self) -> TextRange
fn get_syntax_id(&self) -> LuaSyntaxId
fn get_text(&self) -> String
fn dump(&self) -> String
fn to_ptr(&self) -> LuaAstPtr<Self>where
Self: Sized,
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.