Skip to main content

ContextError

Trait ContextError 

Source
pub trait ContextError<I, C>: Sized {
    // Required method
    fn add_context(location: I, ctx: C, other: Self) -> Self;
}
Expand description

Updated version of nom::error::ContextError. Allows for arbitrary context types, rather than requiring &'static str

Required Methods§

Source

fn add_context(location: I, ctx: C, other: Self) -> Self

Create a new error from an input position, a context, and an existing error. This is used by the .context combinator to add 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".

Implementations on Foreign Types§

Source§

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

Source§

fn add_context(_location: I, _ctx: C, _other: Self) -> Self

Source§

impl<I, C> ContextError<I, C> for (I, ErrorKind)

Source§

fn add_context(_location: I, _ctx: C, other: Self) -> Self

Source§

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

Source§

fn add_context(_location: I, _ctx: C, other: Self) -> Self

Source§

impl<I> ContextError<I, &'static str> for VerboseError<I>

Source§

fn add_context(location: I, ctx: &'static str, other: Self) -> Self

Implementors§

Source§

impl<I, T, C, E> ContextError<I, C> for GenericErrorTree<I, T, C, E>