[−][src]Struct quote::Tokens
Tokens produced by a quote! invocation.
Methods
impl Tokens[src]
impl Tokenspub fn new() -> Self[src]
pub fn new() -> SelfEmpty tokens.
pub fn append<U>(&mut self, token: U) where
U: Into<TokenTree>, [src]
pub fn append<U>(&mut self, token: U) where
U: Into<TokenTree>, For use by ToTokens implementations.
Appends the token specified to this list of tokens.
pub fn append_all<T, I>(&mut self, iter: I) where
T: ToTokens,
I: IntoIterator<Item = T>, [src]
pub fn append_all<T, I>(&mut self, iter: I) where
T: ToTokens,
I: IntoIterator<Item = T>, For use by ToTokens implementations.
struct X; impl ToTokens for X { fn to_tokens(&self, tokens: &mut Tokens) { tokens.append_all(&[true, false]); } } let tokens = quote!(#X); assert_eq!(tokens.to_string(), "true false");
pub fn append_separated<T, I, U>(&mut self, iter: I, op: U) where
T: ToTokens,
I: IntoIterator<Item = T>,
U: ToTokens, [src]
pub fn append_separated<T, I, U>(&mut self, iter: I, op: U) where
T: ToTokens,
I: IntoIterator<Item = T>,
U: ToTokens, For use by ToTokens implementations.
Appends all of the items in the iterator I, separated by the tokens
U.
pub fn append_terminated<T, I, U>(&mut self, iter: I, term: U) where
T: ToTokens,
I: IntoIterator<Item = T>,
U: ToTokens, [src]
pub fn append_terminated<T, I, U>(&mut self, iter: I, term: U) where
T: ToTokens,
I: IntoIterator<Item = T>,
U: ToTokens, For use by ToTokens implementations.
Appends all tokens in the iterator I, appending U after each
element, including after the last element of the iterator.
Trait Implementations
impl ToTokens for Tokens[src]
impl ToTokens for Tokensimpl PartialEq<Tokens> for Tokens[src]
impl PartialEq<Tokens> for Tokensfn eq(&self, other: &Self) -> bool[src]
fn eq(&self, other: &Self) -> bool#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl IntoIterator for Tokens[src]
impl IntoIterator for TokensAllows a Tokens to be passed to Tokens::append_all.
type Item = TokenTree
The type of the elements being iterated over.
type IntoIter = IntoIter
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter[src]
fn into_iter(self) -> Self::IntoIterimpl Default for Tokens[src]
impl Default for Tokensimpl Clone for Tokens[src]
impl Clone for Tokensfn clone(&self) -> Tokens[src]
fn clone(&self) -> Tokensfn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl From<Tokens> for TokenStream[src]
impl From<Tokens> for TokenStreamfn from(tokens: Tokens) -> TokenStream[src]
fn from(tokens: Tokens) -> TokenStreamimpl From<Tokens> for TokenStream[src]
impl From<Tokens> for TokenStreamfn from(tokens: Tokens) -> TokenStream[src]
fn from(tokens: Tokens) -> TokenStreamimpl Display for Tokens[src]
impl Display for Tokensimpl Debug for Tokens[src]
impl Debug for Tokensimpl<'a> Hash for Tokens[src]
impl<'a> Hash for TokensAuto Trait Implementations
Blanket Implementations
impl<T> ToString for T where
T: Display + ?Sized, [src]
impl<T> ToString for T where
T: Display + ?Sized, impl<I> IntoIterator for I where
I: Iterator, [src]
impl<I> IntoIterator for I where
I: Iterator, type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I[src]
fn into_iter(self) -> Iimpl<T> From for T[src]
impl<T> From for Timpl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeIdimpl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut Timpl<E> SpecializationError for E[src]
impl<E> SpecializationError for Eimpl<T> Erased for T[src]
impl<T> Erased for Timpl<T> Send for T where
T: ?Sized, [src]
impl<T> Send for T where
T: ?Sized, impl<T> Sync for T where
T: ?Sized, [src]
impl<T> Sync for T where
T: ?Sized, impl<T> Erased for T
impl<T> Erased for T