pub struct TokenBuilder {
    pub groups: Vec<(Delimiter, TokenStream)>,
}

Fields§

§groups: Vec<(Delimiter, TokenStream)>

Implementations§

source§

impl TokenBuilder

source

pub fn new() -> Self

source

pub fn is_empty(&self) -> bool

source

pub fn end(self) -> TokenStream

source

pub fn eprint(&self)

source

pub fn extend(&mut self, tt: TokenTree) -> &mut Self

source

pub fn stream(&mut self, what: Option<TokenStream>) -> &mut Self

source

pub fn add(&mut self, what: &str) -> &mut Self

source

pub fn ident(&mut self, id: &str) -> &mut Self

source

pub fn ident_with_span(&mut self, id: &str, span: Span) -> &mut Self

source

pub fn punct(&mut self, s: &str) -> &mut Self

source

pub fn lifetime_mark(&mut self) -> &mut Self

source

pub fn sep(&mut self) -> &mut Self

source

pub fn string(&mut self, val: &str) -> &mut Self

source

pub fn unsuf_usize(&mut self, val: usize) -> &mut Self

source

pub fn suf_u16(&mut self, val: u16) -> &mut Self

source

pub fn suf_u32(&mut self, val: u32) -> &mut Self

source

pub fn suf_u64(&mut self, val: u64) -> &mut Self

source

pub fn unsuf_f32(&mut self, val: f32) -> &mut Self

source

pub fn unsuf_f64(&mut self, val: f64) -> &mut Self

source

pub fn unsuf_i64(&mut self, val: i64) -> &mut Self

source

pub fn chr(&mut self, val: char) -> &mut Self

source

pub fn _lit(&mut self, lit: Literal) -> &mut Self

source

pub fn push_group(&mut self, delim: Delimiter) -> &mut Self

source

pub fn stack_as_string(&self) -> String

source

pub fn pop_group(&mut self, delim: Delimiter) -> &mut Self

Trait Implementations§

source§

impl Default for TokenBuilder

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.