pub struct Error<I> {
pub input: I,
pub code: ErrorKind,
}
Expand description
default error type, only contains the error’ location and code
Fields§
§input: I
position of the error in the input data
code: ErrorKind
nom error code
Implementations§
Trait Implementations§
Source§impl<I> ContextError<I> for Error<I>
impl<I> ContextError<I> for Error<I>
Source§fn 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
Source§impl<I: Display> Display for Error<I>
The Display implementation allows the std::error::Error implementation
impl<I: Display> Display for Error<I>
The Display implementation allows the std::error::Error implementation
Source§impl<I> ErrorConvert<Error<(I, usize)>> for Error<I>
impl<I> ErrorConvert<Error<(I, usize)>> for Error<I>
Source§impl<I> ErrorConvert<Error<I>> for Error<(I, usize)>
impl<I> ErrorConvert<Error<I>> for Error<(I, usize)>
Source§impl<I, E> FromExternalError<I, E> for Error<I>
impl<I, E> FromExternalError<I, E> for Error<I>
Source§fn from_external_error(input: I, kind: ErrorKind, _e: E) -> Self
fn from_external_error(input: I, kind: ErrorKind, _e: E) -> Self
Create a new error from an input position and an external error
Source§impl<I> ParseError<I> for Error<I>
impl<I> ParseError<I> for Error<I>
Source§fn from_error_kind(input: I, kind: ErrorKind) -> Self
fn from_error_kind(input: I, kind: ErrorKind) -> Self
Creates an error from the input position and an ErrorKind
Source§fn append(_: I, _: ErrorKind, other: Self) -> Self
fn append(_: I, _: ErrorKind, other: Self) -> Self
Combines an existing error with a new one created from the input
position and an ErrorKind. This is useful when backtracking
through a parse tree, accumulating error context on the way