Struct quote::Tokens [] [src]

pub struct Tokens { /* fields omitted */ }

Tokens produced by a quote! invocation.

Methods

impl Tokens
[src]

[src]

Empty tokens.

[src]

For use by ToTokens implementations.

Appends the token specified to this list of tokens.

[src]

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

[src]

For use by ToTokens implementations.

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

[src]

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]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Default for Tokens
[src]

[src]

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

impl ToTokens for Tokens
[src]

[src]

Write self to the given Tokens. Read more

[src]

Convert self directly into a Tokens object. Read more

impl From<Tokens> for TokenStream
[src]

[src]

Performs the conversion.

impl From<Tokens> for TokenStream
[src]

[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?

[src]

Creates an iterator from a value. Read more

impl Display for Tokens
[src]

[src]

Formats the value using the given formatter. Read more

impl Debug for Tokens
[src]

[src]

Formats the value using the given formatter. Read more

impl PartialEq for Tokens
[src]

[src]

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

1.0.0
[src]

This method tests for !=.

impl<'a> Hash for Tokens
[src]

[src]

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

1.3.0
[src]

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