pub trait GroupExt:
ProcMacroExt<GroupExt = Self>
+ Group
+ Parse<Self::TokenTree>
+ IntoTokens<Self::TokenTree>
+ ToTokens<Self::TokenTree>
+ ToTokenStream<Self::TokenStream> {
// Required method
fn stream_buffer(&self) -> TokenBuffer<Self::TokenTree>;
// Provided methods
fn with_span(
delimiter: Self::Delimiter,
stream: Self::TokenStream,
span: Self::Span,
) -> Self { ... }
fn delimiter_kind(&self) -> DelimiterKind { ... }
fn flatten(&self) -> Option<Self::TokenTree> { ... }
}Expand description
Extensions for Group.
This trait is implemented for Group in proc_macro and proc_macro2 if the
corresponding feature is enabled.
Required Methods§
Sourcefn stream_buffer(&self) -> TokenBuffer<Self::TokenTree>
fn stream_buffer(&self) -> TokenBuffer<Self::TokenTree>
Get the punctuated TokenStream as a TokenBuffer, not including delimiters.
Provided Methods§
Sourcefn with_span(
delimiter: Self::Delimiter,
stream: Self::TokenStream,
span: Self::Span,
) -> Self
fn with_span( delimiter: Self::Delimiter, stream: Self::TokenStream, span: Self::Span, ) -> Self
Create a new Group with a custom span.
Sourcefn delimiter_kind(&self) -> DelimiterKind
fn delimiter_kind(&self) -> DelimiterKind
Get the delimiter of this Group as a matchable enum.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl GroupExt for Group
Available on crate feature proc-macro only.
impl GroupExt for Group
Available on crate feature
proc-macro only.fn stream_buffer(&self) -> TokenBuffer<TokenTree>
Source§impl GroupExt for Group
Available on crate feature proc-macro2 only.
impl GroupExt for Group
Available on crate feature
proc-macro2 only.