Trait LuaAstToken

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

Source

fn syntax(&self) -> &LuaSyntaxToken

Source

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

Source

fn cast(syntax: LuaSyntaxToken) -> Option<Self>
where Self: Sized,

Provided Methods§

Source

fn get_token_kind(&self) -> LuaTokenKind

Source

fn get_position(&self) -> TextSize

Source

fn get_range(&self) -> TextRange

Source

fn get_syntax_id(&self) -> LuaSyntaxId

Source

fn get_text(&self) -> &str

Source

fn get_parent<N: LuaAstNode>(&self) -> Option<N>

Source

fn ancestors<N: LuaAstNode>(&self) -> impl Iterator<Item = N>

Source

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.

Implementors§