devela::_dep::winnow::error

Trait AddContext

pub trait AddContext<I, C = &'static str>: Sized
where I: Stream,
{ // Provided method fn add_context( self, _input: &I, _token_start: &<I as Stream>::Checkpoint, _context: C, ) -> Self { ... } }
Available on crate feature dep_winnow only.
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§

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

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§

§

impl<I, C> AddContext<I, C> for ()
where I: Stream,

Implementors§

§

impl<C, I> AddContext<I, C> for ContextError<C>
where I: Stream,

§

impl<I, C> AddContext<I, C> for ErrorKind
where I: Stream,

§

impl<I, C> AddContext<I, C> for TreeError<I, C>
where I: Stream + Clone,

§

impl<I, C> AddContext<I, C> for InputError<I>
where I: Stream + Clone,

§

impl<I, C, E> AddContext<I, C> for ErrMode<E>
where I: Stream, E: AddContext<I, C>,