Trait nom::error::ContextError
source · pub trait ContextError<I>: Sized {
// Provided method
fn add_context(_input: I, _ctx: &'static str, other: Self) -> Self { ... }
}
Expand description
This trait is required by the context
combinator to add a static string
to an existing error
Provided Methods§
sourcefn add_context(_input: I, _ctx: &'static str, other: Self) -> Self
fn add_context(_input: I, _ctx: &'static str, other: Self) -> Self
Creates a new error from an input position, a static string and an existing error. This is used mainly in the context combinator, to add user friendly information to errors when backtracking through a parse tree
Implementations on Foreign Types§
impl<I> ContextError<I> for ()
impl<I> ContextError<I> for (I, ErrorKind)
Implementors§
impl<I> ContextError<I> for Error<I>
impl<I> ContextError<I> for VerboseError<I>
Available on crate feature
alloc
only.