pub struct Quote { /* private fields */ }
Expand description

Buffer for quasi quotting.

Implementations

Shorthand for

Quote::new(Span::call_site())

Shorthand for

Quote::new(tokens.first_last())

Shorthand for

 tokens
   .as_ref()
   .map(|tokens| Quote::from_tokens(tokens))
   .unwrap_or_else(|| Quote::new(default_span))

Parse tokens as Node. Panics if parsing failed.

Methods for quasi-quotting.

Parse token and append it to self.

Append tt to self.

Respan symbol and append it to self.

Respan and append TokenStream::Group

Appends node into self without respanning.

Trait Implementations

Converts to this type from the input type.
Converts to this type from the input type.
Which kind of iterator are we turning this into?
The type of the elements being iterated over.
Creates an iterator from a value. Read more
Write self to the given TokenStream. Read more
Convert self directly into a TokenStream object. Read more
Convert self directly into a TokenStream object. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Returns a Span covering the complete contents of this syntax tree node, or Span::call_site() if this node is empty. Read more
Usage: Quote::new(body.first_last())
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.