Trait TokenTreeExt

Source
pub trait TokenTreeExt: Sized {
Show 17 methods // Required methods fn as_ident(&self) -> Option<&Ident>; fn as_punct(&self) -> Option<&Punct>; fn as_group(&self) -> Option<&Group>; fn as_literal(&self) -> Option<&Literal>; fn into_ident(self) -> Result<Ident, Self>; fn into_punct(self) -> Result<Punct, Self>; fn into_group(self) -> Result<Group, Self>; fn into_literal(self) -> Result<Literal, Self>; // Provided methods fn is_ident(&self) -> bool { ... } fn is_punct(&self) -> bool { ... } fn is_group(&self) -> bool { ... } fn is_literal(&self) -> bool { ... } fn is_keyword(&self, keyword: &str) -> bool { ... } fn is_punch(&self, ch: char) -> bool { ... } fn is_solid_group(&self) -> bool { ... } fn is_joint(&self) -> bool { ... } fn as_punct_char(&self) -> Option<char> { ... }
}

Required Methods§

Source

fn as_ident(&self) -> Option<&Ident>

Source

fn as_punct(&self) -> Option<&Punct>

Source

fn as_group(&self) -> Option<&Group>

Source

fn as_literal(&self) -> Option<&Literal>

Source

fn into_ident(self) -> Result<Ident, Self>

Source

fn into_punct(self) -> Result<Punct, Self>

Source

fn into_group(self) -> Result<Group, Self>

Source

fn into_literal(self) -> Result<Literal, Self>

Provided Methods§

Source

fn is_ident(&self) -> bool

Source

fn is_punct(&self) -> bool

Source

fn is_group(&self) -> bool

Source

fn is_literal(&self) -> bool

Source

fn is_keyword(&self, keyword: &str) -> bool

Ident content equal to keyword str

Other return false when self is not Ident

Source

fn is_punch(&self, ch: char) -> bool

Punct char equal to ch

Other return false when self is not Punct

Source

fn is_solid_group(&self) -> bool

Group delimiter is not Delimiter::None

Other return false when self is not Group

Source

fn is_joint(&self) -> bool

Punct spacing is Joint

Other return false when self is not Punct

Source

fn as_punct_char(&self) -> Option<char>

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.

Implementations on Foreign Types§

Source§

impl TokenTreeExt for TokenTree

Implementors§