[−][src]Struct pmutil::Quote
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]
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: Parse,
[src]
Node: Parse,
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_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]
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 = <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]
impl From<Quote> for TokenStream
[src]
impl From<Quote> for TokenStream
[src]
impl ToTokens for Quote
[src]
fn to_tokens(&self, dst: &mut TokenStream)
[src]
fn into_token_stream(self) -> TokenStream
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToTokensExt for T where
T: ToTokens,
[src]
T: ToTokens,
fn dump(&self) -> TokenStream
[src]
fn first_last(&self) -> FirstLast
[src]
Usage: Quote::new(body.first_last())
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
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?
fn into_iter(self) -> I
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,