DekiOptTokenTreeExt

Trait DekiOptTokenTreeExt 

Source
pub trait DekiOptTokenTreeExt<'a> {
Show 15 methods // Required methods fn is_any_punct(&self) -> bool; fn is_any_ident(&self) -> bool; fn is_any_group(&self) -> bool; fn is_any_literal(&self) -> bool; fn unwrap_punct(self) -> &'a Punct; fn unwrap_ident(self) -> &'a Ident; fn unwrap_group(self) -> &'a Group; fn unwrap_literal(self) -> &'a Literal; fn map_punct<O: Default, F: FnOnce(&Punct) -> O>(&self, _: F) -> O; fn map_ident<O: Default, F: FnOnce(&Ident) -> O>(&self, _: F) -> O; fn map_group<O: Default, F: FnOnce(&Group) -> O>(&self, _: F) -> O; fn map_literal<O: Default, F: FnOnce(&Literal) -> O>(&self, _: F) -> O; fn is_numeric(&self) -> bool; fn is_string(&self, _: &str) -> bool; fn is_punct(&self, _: char) -> bool;
}
Expand description

This is an extension trait for the following impl:

#[extension(pub trait DekiOptTokenTreeExt)]
impl< 'a > for Option < & 'a TokenTree >

Required Methods§

Source

fn is_any_punct(&self) -> bool

Source

fn is_any_ident(&self) -> bool

Source

fn is_any_group(&self) -> bool

Source

fn is_any_literal(&self) -> bool

Source

fn unwrap_punct(self) -> &'a Punct

Source

fn unwrap_ident(self) -> &'a Ident

Source

fn unwrap_group(self) -> &'a Group

Source

fn unwrap_literal(self) -> &'a Literal

Source

fn map_punct<O: Default, F: FnOnce(&Punct) -> O>(&self, _: F) -> O

Source

fn map_ident<O: Default, F: FnOnce(&Ident) -> O>(&self, _: F) -> O

Source

fn map_group<O: Default, F: FnOnce(&Group) -> O>(&self, _: F) -> O

Source

fn map_literal<O: Default, F: FnOnce(&Literal) -> O>(&self, _: F) -> O

Source

fn is_numeric(&self) -> bool

Source

fn is_string(&self, _: &str) -> bool

Source

fn is_punct(&self, _: char) -> bool

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<'a> DekiOptTokenTreeExt<'a> for Option<&'a TokenTree>

Source§

fn is_any_punct(&self) -> bool

Source§

fn is_any_ident(&self) -> bool

Source§

fn is_any_group(&self) -> bool

Source§

fn is_any_literal(&self) -> bool

Source§

fn unwrap_punct(self) -> &'a Punct

Source§

fn unwrap_ident(self) -> &'a Ident

Source§

fn unwrap_group(self) -> &'a Group

Source§

fn unwrap_literal(self) -> &'a Literal

Source§

fn map_punct<O: Default, F: FnOnce(&Punct) -> O>(&self, check: F) -> O

Source§

fn map_ident<O: Default, F: FnOnce(&Ident) -> O>(&self, check: F) -> O

Source§

fn map_group<O: Default, F: FnOnce(&Group) -> O>(&self, check: F) -> O

Source§

fn map_literal<O: Default, F: FnOnce(&Literal) -> O>(&self, check: F) -> O

Source§

fn is_numeric(&self) -> bool

Source§

fn is_string(&self, text: &str) -> bool

Source§

fn is_punct(&self, punct: char) -> bool

Implementors§