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
Trait Implementations
impl Display for TokenTree
source
impl Display for TokenTree
sourcePrints 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 Extend<TokenTree> for TokenStream
1.30.0 · source
impl Extend<TokenTree> for TokenStream
1.30.0 · sourcefn extend<I: IntoIterator<Item = TokenTree>>(&mut self, trees: I)
source
fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, trees: I)
sourceExtends a collection with the contents of an iterator. Read more
fn extend_reserve(&mut self, additional: usize)
source
fn extend_reserve(&mut self, additional: usize)
sourceReserves capacity in a collection for the given number of additional elements. Read more
impl From<TokenTree> for TokenStream
source
impl From<TokenTree> for TokenStream
sourceCreates a token stream containing a single token tree.
fn from(tree: TokenTree) -> TokenStream
source
fn from(tree: TokenTree) -> TokenStream
sourceConverts to this type from the input type.
impl FromIterator<TokenTree> for TokenStream
source
impl FromIterator<TokenTree> for TokenStream
sourceCollects a number of token trees into a single stream.
fn from_iter<I: IntoIterator<Item = TokenTree>>(trees: I) -> Self
source
fn from_iter<I: IntoIterator<Item = TokenTree>>(trees: I) -> Self
sourceCreates a value from an iterator. Read more
impl !Send for TokenTree
sourceimpl !Sync for TokenTree
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