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§
fn look_and_eat<T: Eat>(&self, token: T, lookahead: &Lookahead1<'a>) -> bool
Sourcefn eat2<T1: Eat, T2: Eat>(&self, t1: T1, t2: T2) -> bool
fn eat2<T1: Eat, T2: Eat>(&self, t1: T1, t2: T2) -> bool
Consumes two tokens T1 T2
if present in that order.
Sourcefn eat3<T1: Eat, T2: Eat, T3: Eat>(&self, t1: T1, t2: T2, t3: T3) -> bool
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.
fn parse_comma_sep<T>( &self, p: fn(_: ParseStream<'_>) -> Result<T>, ) -> Result<Vec<T>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl<'a> ParseBufferExt<'a> for ParseBuffer<'a>
impl<'a> ParseBufferExt<'a> for ParseBuffer<'a>
Source§fn look_and_eat<T: Eat>(&self, token: T, lookahead: &Lookahead1<'a>) -> bool
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.