Trait proc_macro_utils::TokenTreeExt
source · pub trait TokenTreeExt {
// 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-macro
only.Expand description
Generic extensions for
proc_macro::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 TokenTreeExt for TokenTree
impl TokenTreeExt 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.