pub enum TokenTree {
Group(Group),
Ident(Ident),
Punct(Punct),
Literal(Literal),
}Expand description
A single token or a delimited sequence of token trees (e.g. [1, (), ..]).
Variants§
Group(Group)
A token stream surrounded by bracket delimiters.
Ident(Ident)
An identifier.
Punct(Punct)
A single punctuation character (+, ,, $, etc.).
Literal(Literal)
A literal character ('a'), string ("hello"), number (2.3), etc.
Implementations§
Trait Implementations§
Source§impl Display for TokenTree
Prints the token tree as a string that is supposed to be losslessly
convertible back into the same token tree (modulo spans), except for
possibly TokenTree::Groups with Delimiter::None delimiters and negative
numeric literals.
impl Display for TokenTree
Prints the token tree as a string that is supposed to be losslessly
convertible back into the same token tree (modulo spans), except for
possibly TokenTree::Groups with Delimiter::None delimiters and negative
numeric literals.
Source§impl Extend<TokenTree> for TokenStream
impl Extend<TokenTree> for TokenStream
Source§fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, streams: I)
fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, streams: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§#[doc(hidden)]unsafe fn extend_one_unchecked(&mut self, item: A)where
Self: Sized,
#[doc(hidden)]unsafe fn extend_one_unchecked(&mut self, item: A)where
Self: Sized,
🔬This is a nightly-only experimental API. (
extend_one_unchecked)Extends a collection with one element, without checking there is enough capacity for it. Read more
Source§impl From<TokenTree> for TokenStream
impl From<TokenTree> for TokenStream
Source§impl FromIterator<TokenTree> for TokenStream
Collects a number of token trees into a single stream.
impl FromIterator<TokenTree> for TokenStream
Collects a number of token trees into a single stream.
Auto Trait Implementations§
impl Freeze for TokenTree
impl RefUnwindSafe for TokenTree
impl !Send for TokenTree
impl !Sync for TokenTree
impl Unpin for TokenTree
impl UnwindSafe for TokenTree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)]const SIZE: usize = _
#[doc(hidden)]const SIZE: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const ALIGN: usize = _
#[doc(hidden)]const ALIGN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const IS_ZST: bool = _
#[doc(hidden)]const IS_ZST: bool = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const LAYOUT: Layout = _
#[doc(hidden)]const LAYOUT: Layout = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)]const MAX_SLICE_LEN: usize = _
#[doc(hidden)]const MAX_SLICE_LEN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties)The largest safe length for a
[Self]. Read more