OptTreeExt

Trait OptTreeExt 

Source
pub trait OptTreeExt<'a> {
    // Required methods
    fn is_ident(&self) -> bool;
    fn is_string(&self, _: &str) -> bool;
    fn is_numeric(&self) -> bool;
    fn is_punct(&self, _: char) -> bool;
}
Expand description

This is an extension trait for the following impl:

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

Required Methods§

Source

fn is_ident(&self) -> bool

check if this is an ident, use .. && self.is_string(..) for a specific

Source

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

dirty string check of the token

Source

fn is_numeric(&self) -> bool

check if it’s a numeric literal

Source

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

check if it’s a certain punct

Implementors§

Source§

impl<'a> OptTreeExt<'a> for Option<&'a TokenTree>