Enum proc_macro::TokenTree 1.29.0[−][src]
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
impl TokenTree[src]
impl TokenTree[src]Trait Implementations
impl Display for TokenTree[src]
impl Display for TokenTree[src]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 Extend<TokenTree> for TokenStream1.30.0[src]
impl Extend<TokenTree> for TokenStream1.30.0[src]fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, trees: I)[src]
fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, trees: I)[src]Extends a collection with the contents of an iterator. Read more
fn extend_reserve(&mut self, additional: usize)[src]
fn extend_reserve(&mut self, additional: usize)[src]Reserves capacity in a collection for the given number of additional elements. Read more
impl From<TokenTree> for TokenStream[src]
impl From<TokenTree> for TokenStream[src]Creates a token stream containing a single token tree.
fn from(tree: TokenTree) -> TokenStream[src]
fn from(tree: TokenTree) -> TokenStream[src]Performs the conversion.
impl FromIterator<TokenTree> for TokenStream[src]
impl FromIterator<TokenTree> for TokenStream[src]Collects a number of token trees into a single stream.
fn from_iter<I: IntoIterator<Item = TokenTree>>(trees: I) -> Self[src]
fn from_iter<I: IntoIterator<Item = TokenTree>>(trees: I) -> Self[src]Creates a value from an iterator. Read more
impl !Send for TokenTree[src]
impl !Sync for TokenTree[src]
Auto Trait Implementations
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into #41263)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more