Trait rnix::ast::AstToken

source ·
pub trait AstToken {
    // Required methods
    fn can_cast(from: SyntaxKind) -> bool
       where Self: Sized;
    fn cast(from: SyntaxToken) -> Option<Self>
       where Self: Sized;
    fn syntax(&self) -> &SyntaxToken;
}

Required Methods§

source

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

source

fn cast(from: SyntaxToken) -> Option<Self>
where Self: Sized,

Cast an untyped token into this strongly-typed token. This will return None if the type was not correct.

source

fn syntax(&self) -> &SyntaxToken

Implementors§