Struct quote::Tokens [−][src]
Tokens produced by a quote!
invocation.
Methods
impl Tokens
[src]
[−]
impl Tokens
pub fn new() -> Self
[src]
[−]
pub fn new() -> Self
Empty 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 Clone for Tokens
[src]
[+]
impl Clone for Tokens
impl Default for Tokens
[src]
[+]
impl Default for Tokens
impl ToTokens for Tokens
[src]
[+]
impl ToTokens for Tokens
impl From<Tokens> for TokenStream
[src]
[+]
impl From<Tokens> for TokenStream
impl From<Tokens> for TokenStream
[src]
[+]
impl From<Tokens> for TokenStream
impl IntoIterator for Tokens
[src]
[+]
impl IntoIterator for Tokens
impl Display for Tokens
[src]
[+]
impl Display for Tokens
impl Debug for Tokens
[src]
[+]
impl Debug for Tokens
impl PartialEq for Tokens
[src]
[+]
impl PartialEq for Tokens
impl<'a> Hash for Tokens
[src]
[+]
impl<'a> Hash for Tokens