Struct proc_macro::Group
1.29.0 · source · [−]pub struct Group(_);Expand description
A delimited token stream.
A Group internally contains a TokenStream which is surrounded by Delimiters.
Implementations
impl Group
source
impl Group
sourcepub fn new(delimiter: Delimiter, stream: TokenStream) -> Group
source
pub fn new(delimiter: Delimiter, stream: TokenStream) -> Group
sourceCreates a new Group with the given delimiter and token stream.
This constructor will set the span for this group to
Span::call_site(). To change the span you can use the set_span
method below.
pub fn stream(&self) -> TokenStream
source
pub fn stream(&self) -> TokenStream
sourceReturns the TokenStream of tokens that are delimited in this Group.
Note that the returned token stream does not include the delimiter returned above.
pub fn span(&self) -> Span
source
pub fn span(&self) -> Span
sourceReturns the span for the delimiters of this token stream, spanning the
entire Group.
pub fn span(&self) -> Span {
^^^^^^^pub fn span_open(&self) -> Span
1.55.0 · source
pub fn span_open(&self) -> Span
1.55.0 · sourceReturns the span pointing to the opening delimiter of this group.
pub fn span_open(&self) -> Span {
^pub fn span_close(&self) -> Span
1.55.0 · source
pub fn span_close(&self) -> Span
1.55.0 · sourceReturns the span pointing to the closing delimiter of this group.
pub fn span_close(&self) -> Span {
^Trait Implementations
impl Display for Group
source
impl Display for Group
sourcePrints the group as a string that should be losslessly convertible back
into the same group (modulo spans), except for possibly TokenTree::Groups
with Delimiter::None delimiters.
impl !Send for Group
sourceimpl !Sync for Group
sourceAuto Trait Implementations
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
source
impl<T> BorrowMut<T> for T where
T: ?Sized,
sourcefn borrow_mut(&mut self) -> &mut T
const: unstable · source
fn borrow_mut(&mut self) -> &mut T
const: unstable · sourceMutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
source
impl<T> ToOwned for T where
T: Clone,
sourcetype Owned = T
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)
source
fn clone_into(&self, target: &mut T)
sourceUses borrowed data to replace owned data, usually by cloning. Read more