pub struct TokenParser {
    pub current: Option<TokenTree>,
    /* private fields */
}

Fields§

§current: Option<TokenTree>

Implementations§

source§

impl TokenParser

source

pub fn new(start: TokenStream) -> Self

source

pub fn advance(&mut self)

source

pub fn unexpected(&self) -> TokenStream

source

pub fn is_delim(&mut self, delim: Delimiter) -> bool

source

pub fn is_brace(&mut self) -> bool

source

pub fn is_paren(&mut self) -> bool

source

pub fn is_bracket(&mut self) -> bool

source

pub fn open_delim(&mut self, delim: Delimiter) -> bool

source

pub fn is_group_with_delim(&mut self, delim: Delimiter) -> bool

source

pub fn open_group(&mut self) -> Option<Delimiter>

source

pub fn open_brace(&mut self) -> bool

source

pub fn open_paren(&mut self) -> bool

source

pub fn open_bracket(&mut self) -> bool

source

pub fn is_eot(&mut self) -> bool

source

pub fn eat_eot(&mut self) -> bool

source

pub fn eat_level(&mut self) -> TokenStream

source

pub fn eat_level_or_punct(&mut self, what: char) -> TokenStream

source

pub fn eat_ident(&mut self, what: &str) -> bool

source

pub fn is_literal(&mut self) -> bool

source

pub fn eat_literal(&mut self) -> Option<Literal>

source

pub fn span(&self) -> Option<Span>

source

pub fn is_punct_alone(&mut self, what: char) -> bool

source

pub fn is_punct_any(&mut self, what: char) -> bool

source

pub fn eat_double_colon_destruct(&mut self) -> bool

source

pub fn eat_sep(&mut self) -> bool

source

pub fn eat_punct_alone(&mut self, what: char) -> bool

source

pub fn eat_punct_any(&mut self, what: char) -> bool

source

pub fn eat_any_punct(&mut self) -> Option<String>

source

pub fn eat_any_ident(&mut self) -> Option<String>

source

pub fn eat_any_ident_with_span(&mut self) -> Option<(String, Span)>

source

pub fn expect_any_ident(&mut self) -> Result<String, TokenStream>

source

pub fn expect_punct_alone(&mut self, what: char) -> Result<(), TokenStream>

source

pub fn expect_punct_any(&mut self, what: char) -> Result<(), TokenStream>

source

pub fn eat_ident_path(&mut self) -> Option<TokenStream>

source

pub fn eat_where_clause( &mut self, add_where: Option<&str> ) -> Option<TokenStream>

source

pub fn eat_struct_field(&mut self) -> Option<StructField>

source

pub fn eat_attributes(&mut self) -> Vec<Attribute>

source

pub fn eat_all_struct_fields(&mut self) -> Option<Vec<StructField>>

source

pub fn eat_generic(&mut self) -> Option<TokenStream>

source

pub fn eat_all_types(&mut self) -> Option<Vec<TokenStream>>

source

pub fn eat_type(&mut self) -> Option<TokenStream>

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.