Skip to main content

ParserContext

Trait ParserContext 

Source
pub trait ParserContext<'a, Input, Out>
where Input: Stream,
{ // Required methods fn label( self, label: &'static str, ) -> Context<Self, Input, Out, ErrMode<ContextError>, StrContext> where Self: Sized + Parser<Input, Out, ErrMode<ContextError>>; fn expected( self, description: &'static str, ) -> Context<Self, Input, Out, ErrMode<ContextError>, StrContext> where Self: Sized + Parser<Input, Out, ErrMode<ContextError>>; fn expected_str( self, literal: &'static str, ) -> Context<Self, Input, Out, ErrMode<ContextError>, StrContext> where Self: Sized + Parser<Input, Out, ErrMode<ContextError>>; fn expected_char( self, literal: char, ) -> Context<Self, Input, Out, ErrMode<ContextError>, StrContext> where Self: Sized + Parser<Input, Out, ErrMode<ContextError>>; }
Expand description

Wraps winnow’s context error reporting with short names.

Required Methods§

Source

fn label( self, label: &'static str, ) -> Context<Self, Input, Out, ErrMode<ContextError>, StrContext>
where Self: Sized + Parser<Input, Out, ErrMode<ContextError>>,

Description of what is currently being parsed.

Source

fn expected( self, description: &'static str, ) -> Context<Self, Input, Out, ErrMode<ContextError>, StrContext>
where Self: Sized + Parser<Input, Out, ErrMode<ContextError>>,

Description of what was expected.

Source

fn expected_str( self, literal: &'static str, ) -> Context<Self, Input, Out, ErrMode<ContextError>, StrContext>
where Self: Sized + Parser<Input, Out, ErrMode<ContextError>>,

A &str token.

Source

fn expected_char( self, literal: char, ) -> Context<Self, Input, Out, ErrMode<ContextError>, StrContext>
where Self: Sized + Parser<Input, Out, ErrMode<ContextError>>,

A char token.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a, P, Input, Out> ParserContext<'a, Input, Out> for P
where P: Parser<Input, Out, ErrMode<ContextError>>, Input: Stream,