Skip to main content

TokenParser

Struct TokenParser 

Source
pub struct TokenParser { /* private fields */ }

Implementations§

Source§

impl TokenParser

Source

pub fn eat_function(&mut self) -> Option<Function>

Source

pub fn eat_function_parameter(&mut self) -> Option<FunctionParameter>

Source

pub fn new(start: TokenStream) -> Self

Source

pub fn backtrack(&mut self, ts: TokenStream)

Source

pub fn peek(&mut self) -> Option<&TokenTree>

Source

pub fn advance(&mut self)

Source

pub fn advance_if<T>( &mut self, cond: impl FnOnce(&TokenTree) -> Option<T>, ) -> Option<T>

Source

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

Source

pub fn open_brace(&mut self) -> bool

Source

pub fn open_paren(&mut self) -> bool

Source

pub fn is_eot(&mut self) -> bool

Source

pub fn eat_eot(&mut self) -> bool

Source

pub fn eat_ident(&mut self, what: &str) -> Option<Ident>

Source

pub fn eat_punct_with_spacing( &mut self, what: char, spacing: Spacing, ) -> Option<Punct>

Source

pub fn eat_punct(&mut self, what: char) -> Option<Punct>

Source

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

Source

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

Source

pub fn eat_type_bound_where_clause_item(&mut self) -> Option<WhereClauseItem>

Source

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

Source

pub fn eat_lifetime_where_clause_item(&mut self) -> Option<WhereClauseItem>

Source

pub fn eat_where_clause_item(&mut self) -> Option<WhereClauseItem>

Source

pub fn eat_where_clause(&mut self) -> Option<WhereClause>

Source

pub fn eat_struct(&mut self) -> Option<Struct>

Source

pub fn eat_enum_item(&mut self) -> Option<EnumItem>

Source

pub fn eat_enumeration(&mut self) -> Option<Enum>

Source

pub fn eat_lifetime_param(&mut self) -> Option<LifetimeParam>

Source

pub fn eat_type_param(&mut self) -> Option<TypeParam>

Source

pub fn eat_generics(&mut self) -> Generics

Source

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

Source

pub fn eat_tuple_field(&mut self, i: usize) -> Option<StructField>

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn eat_type_no_bounds(&mut self) -> Option<Ty>

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn eat_group(&mut self, delim: Delimiter) -> Option<TokenTree>

Source

pub fn eat_any_group(&mut self) -> Option<TokenTree>

Source

pub fn eat_visibility(&mut self) -> TokenStream

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.