pub trait Group: ProcMacro<Group = Self> + Display {
// Required methods
fn new(delimiter: Self::Delimiter, stream: Self::TokenStream) -> Self;
fn delimiter(&self) -> Self::Delimiter;
fn stream(&self) -> Self::TokenStream;
fn span(&self) -> Self::Span;
fn span_open(&self) -> Self::Span;
fn span_close(&self) -> Self::Span;
fn set_span(&mut self, span: Self::Span);
}
Expand description
Group
API trait. See proc_macro::Group
.
This trait is implemented for Group
in proc_macro
and proc_macro2
if the
corresponding feature is enabled.
See also GroupExt
.
Required Methods§
Sourcefn new(delimiter: Self::Delimiter, stream: Self::TokenStream) -> Self
fn new(delimiter: Self::Delimiter, stream: Self::TokenStream) -> Self
Create a new Group
. The span will be set to Span::call_site()
.
Sourcefn stream(&self) -> Self::TokenStream
fn stream(&self) -> Self::TokenStream
Get the punctuated TokenStream
, not including delimiters.
Sourcefn span_close(&self) -> Self::Span
fn span_close(&self) -> Self::Span
Get the span of the group’s closing delimiter.
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 Group for Group
Available on crate feature proc-macro
only.
impl Group for Group
Available on crate feature
proc-macro
only.fn new(delimiter: Self::Delimiter, stream: Self::TokenStream) -> Self
fn delimiter(&self) -> Self::Delimiter
fn stream(&self) -> Self::TokenStream
fn span(&self) -> Self::Span
fn span_open(&self) -> Self::Span
fn span_close(&self) -> Self::Span
fn set_span(&mut self, span: Self::Span)
Source§impl Group for Group
Available on crate feature proc-macro2
only.
impl Group for Group
Available on crate feature
proc-macro2
only.