Trait mz_expr_parser::parser::util::ParseBufferExt

source ·
pub trait ParseBufferExt<'a> {
    // Required methods
    fn look_and_eat<T: Eat>(&self, token: T, lookahead: &Lookahead1<'a>) -> bool;
    fn eat<T: Eat>(&self, t: T) -> bool;
    fn eat2<T1: Eat, T2: Eat>(&self, t1: T1, t2: T2) -> bool;
    fn eat3<T1: Eat, T2: Eat, T3: Eat>(&self, t1: T1, t2: T2, t3: T3) -> bool;
    fn parse_comma_sep<T>(
        &self,
        p: fn(_: ParseStream<'_>) -> Result<T>,
    ) -> Result<Vec<T>>;
}
Expand description

Extension methods for syn::parse::ParseBuffer.

Required Methods§

source

fn look_and_eat<T: Eat>(&self, token: T, lookahead: &Lookahead1<'a>) -> bool

source

fn eat<T: Eat>(&self, t: T) -> bool

Consumes a token T if present.

source

fn eat2<T1: Eat, T2: Eat>(&self, t1: T1, t2: T2) -> bool

Consumes two tokens T1 T2 if present in that order.

source

fn eat3<T1: Eat, T2: Eat, T3: Eat>(&self, t1: T1, t2: T2, t3: T3) -> bool

Consumes three tokens T1 T2 T3 if present in that order.

source

fn parse_comma_sep<T>( &self, p: fn(_: ParseStream<'_>) -> Result<T>, ) -> Result<Vec<T>>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a> ParseBufferExt<'a> for ParseBuffer<'a>

source§

fn look_and_eat<T: Eat>(&self, token: T, lookahead: &Lookahead1<'a>) -> bool

Consumes a token T if present, looking it up using the provided Lookahead1 instance.

source§

fn eat<T: Eat>(&self, t: T) -> bool

source§

fn eat2<T1: Eat, T2: Eat>(&self, t1: T1, t2: T2) -> bool

source§

fn eat3<T1: Eat, T2: Eat, T3: Eat>(&self, t1: T1, t2: T2, t3: T3) -> bool

source§

fn parse_comma_sep<T>( &self, p: fn(_: ParseStream<'_>) -> Result<T>, ) -> Result<Vec<T>>

Implementors§