Struct futures_await_quote::Tokens
[−]
[src]
pub struct Tokens { /* fields omitted */ }
Tokens produced by a quote!(...)
invocation.
Methods
impl Tokens
[src]
fn new() -> Self
[src]
Empty tokens.
fn append<U>(&mut self, token: U) where
U: Into<TokenTree>,
[src]
U: Into<TokenTree>,
For use by ToTokens
implementations.
Appends the token specified to this list of tokens.
fn append_tokens<T: ToTokens>(&mut self, tokens: T)
[src]
Add tokens
into self
.
fn append_sym(&mut self, sym: &str, span: Span)
[src]
Add the symbol specified to this list of tokens.
fn append_delimited<F, R>(&mut self, delim: &str, span: Span, f: F) -> R where
F: FnOnce(&mut Tokens) -> R,
[src]
F: FnOnce(&mut Tokens) -> R,
fn append_all<T, I>(&mut self, iter: I) where
T: ToTokens,
I: IntoIterator<Item = T>,
[src]
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");
fn append_separated<T, I, U>(&mut self, iter: I, op: U) where
T: ToTokens,
I: IntoIterator<Item = T>,
U: ToTokens,
[src]
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
.
fn append_terminated<T, I, U>(&mut self, iter: I, term: U) where
T: ToTokens,
I: IntoIterator<Item = T>,
U: ToTokens,
[src]
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]
fn clone(&self) -> Tokens
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for Tokens
[src]
impl ToTokens for Tokens
[src]
fn to_tokens(&self, dst: &mut Tokens)
[src]
Write self
to the given Tokens
. Read more
fn into_tokens(self) -> Tokens
[src]
Convert self
directly into a Tokens
object. Read more