[][src]Trait ra_ap_syntax::ast::AstToken

pub trait AstToken {
    pub fn can_cast(token: SyntaxKind) -> bool
    where
        Self: Sized
;
pub fn cast(syntax: SyntaxToken) -> Option<Self>
    where
        Self: Sized
;
pub fn syntax(&self) -> &SyntaxToken; pub fn text(&self) -> &SmolStr { ... } }

Like AstNode, but wraps tokens rather than interior nodes.

Required methods

pub fn can_cast(token: SyntaxKind) -> bool where
    Self: Sized
[src]

pub fn cast(syntax: SyntaxToken) -> Option<Self> where
    Self: Sized
[src]

pub fn syntax(&self) -> &SyntaxToken[src]

Loading content...

Provided methods

pub fn text(&self) -> &SmolStr[src]

Loading content...

Implementors

impl AstToken for ByteString[src]

impl AstToken for Comment[src]

impl AstToken for FloatNumber[src]

impl AstToken for IntNumber[src]

impl AstToken for String[src]

impl AstToken for Whitespace[src]

Loading content...