Trait winnow::error::AddContext
source · pub trait AddContext<I: Stream, C = &'static str>: Sized {
// Provided method
fn add_context(
self,
_input: &I,
_token_start: &<I as Stream>::Checkpoint,
_context: C,
) -> Self { ... }
}
Expand description
Used by Parser::context
to add custom data to error while backtracking
May be implemented multiple times for different kinds of context.
Provided Methods§
sourcefn add_context(
self,
_input: &I,
_token_start: &<I as Stream>::Checkpoint,
_context: C,
) -> Self
fn add_context( self, _input: &I, _token_start: &<I as Stream>::Checkpoint, _context: C, ) -> Self
Append to an existing error custom data
This is used mainly by Parser::context
, to add user friendly information
to errors when backtracking through a parse tree
Object Safety§
This trait is not object safe.