Struct pmutil::Quote
[−]
[src]
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: &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]
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]
pub fn parse<Node>(self) -> Node where
Node: Synom,
[src]
Node: Synom,
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]
F: FnOnce(&mut Self),
pub fn push_parsed(&mut self, token: &str)
[src]
Parse token
and append it to self
.
pub fn push_node(&mut self, node: TokenNode)
[src]
Respan token and append it 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]
F: FnOnce(&mut Quote),
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 IntoIterator for Quote
[src]
type IntoIter = TokenTreeIter
Which kind of iterator are we turning this into?
type Item = TokenTree
The type of the elements being iterated over.
fn into_iter(self) -> Self::IntoIter
[src]
Creates an iterator from a value. Read more