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.
Object Safety§
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.