Trait winnow::error::AddContext

source ·
pub trait AddContext<I, C = &'static str>: Sized {
    // Provided method
    fn add_context(self, _input: &I, _ctx: 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§

source

fn add_context(self, _input: &I, _ctx: 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.

Implementations on Foreign Types§

source§

impl<I, C> AddContext<I, C> for ()

Implementors§

source§

impl<C, I> AddContext<I, C> for ContextError<C>

source§

impl<I, C> AddContext<I, C> for ErrorKind

source§

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

source§

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

source§

impl<I: Clone, C> AddContext<I, C> for InputError<I>

source§

impl<I: Clone, C> AddContext<I, C> for VerboseError<I, C>