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§
Sourcefn label(
self,
label: &'static str,
) -> Context<Self, Input, Out, ErrMode<ContextError>, StrContext>
fn label( self, label: &'static str, ) -> Context<Self, Input, Out, ErrMode<ContextError>, StrContext>
Description of what is currently being parsed.
Sourcefn expected(
self,
description: &'static str,
) -> Context<Self, Input, Out, ErrMode<ContextError>, StrContext>
fn expected( self, description: &'static str, ) -> Context<Self, Input, Out, ErrMode<ContextError>, StrContext>
Description of what was expected.
Sourcefn expected_str(
self,
literal: &'static str,
) -> Context<Self, Input, Out, ErrMode<ContextError>, StrContext>
fn expected_str( self, literal: &'static str, ) -> Context<Self, Input, Out, ErrMode<ContextError>, StrContext>
A &str token.
Sourcefn expected_char(
self,
literal: char,
) -> Context<Self, Input, Out, ErrMode<ContextError>, StrContext>
fn expected_char( self, literal: char, ) -> Context<Self, Input, Out, ErrMode<ContextError>, StrContext>
A char token.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".