pub trait LuaAstToken {
// Required methods
fn syntax(&self) -> &LuaSyntaxToken;
fn can_cast(kind: LuaTokenKind) -> bool
where Self: Sized;
fn cast(syntax: LuaSyntaxToken) -> Option<Self>
where Self: Sized;
// Provided methods
fn get_token_kind(&self) -> LuaTokenKind { ... }
fn get_position(&self) -> TextSize { ... }
fn get_range(&self) -> TextRange { ... }
fn get_syntax_id(&self) -> LuaSyntaxId { ... }
fn get_text(&self) -> &str { ... }
fn get_parent<N: LuaAstNode>(&self) -> Option<N> { ... }
fn ancestors<N: LuaAstNode>(&self) -> impl Iterator<Item = N> { ... }
fn dump(&self) -> String { ... }
}Required Methods§
fn syntax(&self) -> &LuaSyntaxToken
fn can_cast(kind: LuaTokenKind) -> boolwhere
Self: Sized,
fn cast(syntax: LuaSyntaxToken) -> Option<Self>where
Self: Sized,
Provided Methods§
fn get_token_kind(&self) -> LuaTokenKind
fn get_position(&self) -> TextSize
fn get_range(&self) -> TextRange
fn get_syntax_id(&self) -> LuaSyntaxId
fn get_text(&self) -> &str
fn get_parent<N: LuaAstNode>(&self) -> Option<N>
fn ancestors<N: LuaAstNode>(&self) -> impl Iterator<Item = N>
fn dump(&self) -> String
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.