Struct quote::Tokens[][src]

pub struct Tokens { /* fields omitted */ }

Tokens produced by a quote! invocation.

Methods

impl Tokens
[src]

Empty tokens.

For use by ToTokens implementations.

Appends the token specified to this list of tokens.

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");

For use by ToTokens implementations.

Appends all of the items in the iterator I, separated by the tokens U.

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]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for Tokens
[src]

Returns the "default value" for a type. Read more

impl ToTokens for Tokens
[src]

Write self to the given Tokens. Read more

Convert self directly into a Tokens object. Read more

impl From<Tokens> for TokenStream
[src]

Performs the conversion.

impl From<Tokens> for TokenStream
[src]

Performs the conversion.

impl IntoIterator for Tokens
[src]

Allows a Tokens to be passed to Tokens::append_all.

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

impl Display for Tokens
[src]

Formats the value using the given formatter. Read more

impl Debug for Tokens
[src]

Formats the value using the given formatter. Read more

impl PartialEq for Tokens
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<'a> Hash for Tokens
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl !Send for Tokens

impl !Sync for Tokens