Trait proclet::Group

source ·
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§

source

fn new(delimiter: Self::Delimiter, stream: Self::TokenStream) -> Self

Create a new Group. The span will be set to Span::call_site().

source

fn delimiter(&self) -> Self::Delimiter

Get the delimiter of this Group.

source

fn stream(&self) -> Self::TokenStream

Get the punctuated TokenStream, not including delimiters.

source

fn span(&self) -> Self::Span

Get the span of this Group.

source

fn span_open(&self) -> Self::Span

Get the span of the group’s opening delimiter.

source

fn span_close(&self) -> Self::Span

Get the span of the group’s closing delimiter.

source

fn set_span(&mut self, span: Self::Span)

Set the span of this Group. This does not set the span of the contained TokenStream.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Group for Group

Available on crate feature proc-macro only.
source§

fn new(delimiter: Self::Delimiter, stream: Self::TokenStream) -> Self

source§

fn delimiter(&self) -> Self::Delimiter

source§

fn stream(&self) -> Self::TokenStream

source§

fn span(&self) -> Self::Span

source§

fn span_open(&self) -> Self::Span

source§

fn span_close(&self) -> Self::Span

source§

fn set_span(&mut self, span: Self::Span)

source§

impl Group for Group

Available on crate feature proc-macro2 only.
source§

fn new(delimiter: Self::Delimiter, stream: Self::TokenStream) -> Self

source§

fn delimiter(&self) -> Self::Delimiter

source§

fn stream(&self) -> Self::TokenStream

source§

fn span(&self) -> Self::Span

source§

fn span_open(&self) -> Self::Span

source§

fn span_close(&self) -> Self::Span

source§

fn set_span(&mut self, span: Self::Span)

Implementors§