pub struct GroupWithMetadata<G, I = G, P = G, L = I> {
pub delimiter: Delimiter,
pub contents: TokenWithMetadataVec<G, I, P, L>,
pub span: Span,
pub metadata: G,
}Expand description
A version of Group with arbitrary attached metadata. The tokens within
this GroupWithMetadata also have metadata.
The fields of this struct are public, unlike Group’s. There are no
getter/setter methods: use the fields directly.
See proc_macro2’s documentation for more information on Group.
Fields§
§delimiter: DelimiterSee Group::delimiter.
contents: TokenWithMetadataVec<G, I, P, L>A vector holding the tokens within this group, each with their own metadata.
span: SpanSee Group::span.
This span covers the entire group, including the delimiters.
metadata: GThe associated metadata.
Implementations§
Source§impl<G, I, P, L> GroupWithMetadata<G, I, P, L>
impl<G, I, P, L> GroupWithMetadata<G, I, P, L>
Sourcepub fn strip_metadata(self) -> Group
pub fn strip_metadata(self) -> Group
Strips the metadata from this GroupWithMetadata, returning an
ordinary Group.
The tokens within the group will also be stripped of their metadata.
Sourcepub fn delimiter(&self) -> Delimiter
👎Deprecated: Use the delimiter field directly.
pub fn delimiter(&self) -> Delimiter
Use the delimiter field directly.
See Group::delimiter.
Sourcepub fn span(&self) -> Span
👎Deprecated: Use the span field directly.
pub fn span(&self) -> Span
Use the span field directly.
See Group::span.
Sourcepub fn span_open(&self) -> Span
pub fn span_open(&self) -> Span
See Group::span_open.
Sourcepub fn span_close(&self) -> Span
pub fn span_close(&self) -> Span
See Group::span_close.
Sourcepub fn delim_span(&self) -> DelimSpan
pub fn delim_span(&self) -> DelimSpan
See Group::delim_span.
Sourcepub fn set_span(&mut self, span: Span)
👎Deprecated: Use the span field directly.
pub fn set_span(&mut self, span: Span)
Use the span field directly.
See Group::set_span.
Trait Implementations§
Source§impl<G: Clone, I: Clone, P: Clone, L: Clone> Clone for GroupWithMetadata<G, I, P, L>
impl<G: Clone, I: Clone, P: Clone, L: Clone> Clone for GroupWithMetadata<G, I, P, L>
Source§fn clone(&self) -> GroupWithMetadata<G, I, P, L>
fn clone(&self) -> GroupWithMetadata<G, I, P, L>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more