Trait proc_macro_utils::TokenTree2Ext
source · pub trait TokenTree2Ext {
// Required methods
fn is_group(&self) -> bool;
fn group(&self) -> Option<&Group>;
fn into_group(self) -> Option<Group>;
fn is_ident(&self) -> bool;
fn ident(&self) -> Option<&Ident>;
fn into_ident(self) -> Option<Ident>;
fn is_punct(&self) -> bool;
fn punct(&self) -> Option<&Punct>;
fn into_punct(self) -> Option<Punct>;
fn is_literal(&self) -> bool;
fn literal(&self) -> Option<&Literal>;
fn into_literal(self) -> Option<Literal>;
}
Available on crate feature
proc-macro2
only.Expand description
Generic extensions for
proc_macro2::TokenTree
Required Methods§
sourcefn into_group(self) -> Option<Group>
fn into_group(self) -> Option<Group>
sourcefn into_ident(self) -> Option<Ident>
fn into_ident(self) -> Option<Ident>
sourcefn into_punct(self) -> Option<Punct>
fn into_punct(self) -> Option<Punct>
sourcefn is_literal(&self) -> bool
fn is_literal(&self) -> bool
Tests if the token tree is a literal.
Implementations on Foreign Types§
source§impl TokenTree2Ext for TokenTree
impl TokenTree2Ext for TokenTree
source§fn into_group(self) -> Option<Group>
fn into_group(self) -> Option<Group>
source§fn into_ident(self) -> Option<Ident>
fn into_ident(self) -> Option<Ident>
source§fn into_punct(self) -> Option<Punct>
fn into_punct(self) -> Option<Punct>
source§fn is_literal(&self) -> bool
fn is_literal(&self) -> bool
Tests if the token tree is a literal.