pub trait TokenTree2Ext: Sealed {
// 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.