[][src]Struct pmutil::Quote

pub struct Quote { /* fields omitted */ }

Buffer for quasi quotting.

Methods

impl Quote[src]

pub fn new<S: Respan + 'static>(span: S) -> Self[src]

pub fn new_call_site() -> Self[src]

Shorthand for

This example is not tested
Quote::new(Span::call_site())

pub fn from_tokens(tokens: &dyn ToTokens) -> Self[src]

Shorthand for

This example is not tested
Quote::new(tokens.first_last())

pub fn from_tokens_or<T: ToTokens>(
    tokens: &Option<T>,
    default_span: Span
) -> Self
[src]

Shorthand for

This example is not tested
 tokens
   .as_ref()
   .map(|tokens| Quote::from_tokens(tokens))
   .unwrap_or_else(|| Quote::new(default_span))

impl Quote[src]

pub fn parse<Node>(self) -> Node where
    Node: Parse
[src]

Parse tokens as Node. Panics if parsing failed.

impl Quote[src]

Methods for quasi-quotting.

pub fn quote_with<F>(self, quote: F) -> Self where
    F: FnOnce(&mut Self), 
[src]

pub fn push_parsed(&mut self, token: &str)[src]

Parse token and append it to self.

pub fn push_tt(&mut self, tt: TokenTree)[src]

Append tt to self.

pub fn push_sym(&mut self, term: &str)[src]

Respan symbol and append it to self.

pub fn push_group<F>(&mut self, delim: Delimiter, child: F) where
    F: FnOnce(&mut Quote), 
[src]

Respan and append TokenStream::Group

pub fn push_tokens<T: ?Sized + ToTokens>(&mut self, node: &T)[src]

Appends node into self without respanning.

Trait Implementations

impl From<Quote> for TokenStream[src]

impl From<Quote> for TokenStream[src]

impl IntoIterator for Quote[src]

type IntoIter = <TokenStream as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?

type Item = <TokenStream as IntoIterator>::Item

The type of the elements being iterated over.

impl ToTokens for Quote[src]

Auto Trait Implementations

impl !Send for Quote

impl !Sync for Quote

impl Unpin for Quote

impl !UnwindSafe for Quote

impl !RefUnwindSafe for Quote

Blanket Implementations

impl<T> ToTokensExt for T where
    T: ToTokens
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]