Struct pmutil::Quote [−][src]
pub struct Quote { /* fields omitted */ }
Buffer for quasi quotting.
Methods
impl Quote
[src]
impl Quote
pub fn new<S: Respan + 'static>(span: S) -> Self
[src]
pub fn new<S: Respan + 'static>(span: S) -> Self
pub fn new_call_site() -> Self
[src]
pub fn new_call_site() -> Self
Shorthand for
ⓘThis example is not tested
Quote::new(Span::call_site())
pub fn from_tokens(tokens: &ToTokens) -> Self
[src]
pub fn from_tokens(tokens: &ToTokens) -> Self
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]
pub fn from_tokens_or<T: ToTokens>(
tokens: &Option<T>,
default_span: Span
) -> Self
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]
impl Quote
pub fn parse<Node>(self) -> Node where
Node: Synom,
[src]
pub fn parse<Node>(self) -> Node where
Node: Synom,
Parse tokens as Node
.
Panics if parsing failed.
impl Quote
[src]
impl Quote
Methods for quasi-quotting.
pub fn quote_with<F>(self, quote: F) -> Self where
F: FnOnce(&mut Self),
[src]
pub fn quote_with<F>(self, quote: F) -> Self where
F: FnOnce(&mut Self),
pub fn push_parsed(&mut self, token: &str)
[src]
pub fn push_parsed(&mut self, token: &str)
Parse token
and append it to self
.
pub fn push_tt(&mut self, tt: TokenTree)
[src]
pub fn push_tt(&mut self, tt: TokenTree)
Append tt
to self
.
pub fn push_sym(&mut self, term: &str)
[src]
pub fn push_sym(&mut self, term: &str)
Respan symbol and append it to self
.
pub fn push_group<F>(&mut self, delim: Delimiter, child: F) where
F: FnOnce(&mut Quote),
[src]
pub fn push_group<F>(&mut self, delim: Delimiter, child: F) where
F: FnOnce(&mut Quote),
Respan and append TokenStream::Group
pub fn push_tokens<T: ?Sized + ToTokens>(&mut self, node: &T)
[src]
pub fn push_tokens<T: ?Sized + ToTokens>(&mut self, node: &T)
Appends node into self
without respanning.
Trait Implementations
impl IntoIterator for Quote
[src]
impl IntoIterator for Quote
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.
fn into_iter(self) -> Self::IntoIter
[src]
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl From<Quote> for TokenStream
[src]
impl From<Quote> for TokenStream
impl From<Quote> for TokenStream
[src]
impl From<Quote> for TokenStream
impl ToTokens for Quote
[src]
impl ToTokens for Quote
fn to_tokens(&self, dst: &mut TokenStream)
[src]
fn to_tokens(&self, dst: &mut TokenStream)
Write self
to the given TokenStream
. Read more
fn into_token_stream(self) -> TokenStream
[src]
fn into_token_stream(self) -> TokenStream
Convert self
directly into a TokenStream
object. Read more