Trait proc_macro_utils::TokenStream2Ext
source · pub trait TokenStream2Ext: Sealed {
// Required methods
fn push(&mut self, token: TokenTree);
fn parser(self) -> TokenParser<IntoIter> ⓘ;
fn parser_generic<const PEEKER_LEN: usize>(
self
) -> TokenParser<IntoIter, PEEKER_LEN> ⓘ;
}
Available on crate feature
proc-macro2
only.Expand description
Generic extensions for
proc_macro2::TokenStream
Required Methods§
sourcefn parser(self) -> TokenParser<IntoIter> ⓘ
Available on crate feature parser
only.
fn parser(self) -> TokenParser<IntoIter> ⓘ
parser
only.Creates a TokenParser
from this token stream.
sourcefn parser_generic<const PEEKER_LEN: usize>(
self
) -> TokenParser<IntoIter, PEEKER_LEN> ⓘ
Available on crate feature parser
only.
fn parser_generic<const PEEKER_LEN: usize>( self ) -> TokenParser<IntoIter, PEEKER_LEN> ⓘ
parser
only.Creates a TokenParser
from this token stream.
Allows to specify the length of the peeker buffer.
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl TokenStream2Ext for TokenStream
impl TokenStream2Ext for TokenStream
source§fn parser(self) -> TokenParser<IntoIter> ⓘ
Available on crate feature parser
only.
fn parser(self) -> TokenParser<IntoIter> ⓘ
parser
only.Creates a TokenParser
from this token stream.
source§fn parser_generic<const PEEKER_LEN: usize>(
self
) -> TokenParser<IntoIter, PEEKER_LEN> ⓘ
Available on crate feature parser
only.
fn parser_generic<const PEEKER_LEN: usize>( self ) -> TokenParser<IntoIter, PEEKER_LEN> ⓘ
parser
only.Creates a TokenParser
from this token stream.
Allows to specify the length of the peeker buffer.