Enum proc_macro::TokenTree
1.29.0 · source · [−]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
sourceimpl TokenTree
impl TokenTree
Trait Implementations
sourceimpl Display for TokenTree
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::Group
s
with Delimiter::None
delimiters and negative numeric literals.
1.30.0 · sourceimpl Extend<TokenTree> for TokenStream
impl Extend<TokenTree> for TokenStream
sourcefn extend<I: IntoIterator<Item = TokenTree>>(&mut self, trees: I)
fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, trees: I)
Extends a collection with the contents of an iterator. Read more
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl From<TokenTree> for TokenStream
impl From<TokenTree> for TokenStream
Creates a token stream containing a single token tree.
sourcefn from(tree: TokenTree) -> TokenStream
fn from(tree: TokenTree) -> TokenStream
Performs the conversion.
sourceimpl FromIterator<TokenTree> for TokenStream
impl FromIterator<TokenTree> for TokenStream
Collects a number of token trees into a single stream.
sourcefn from_iter<I: IntoIterator<Item = TokenTree>>(trees: I) -> Self
fn from_iter<I: IntoIterator<Item = TokenTree>>(trees: I) -> Self
Creates a value from an iterator. Read more
impl !Send for TokenTree
impl !Sync for TokenTree
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more