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>
impl<I: Display> Display for Error<I>
The Display implementation allows the std::error::Error implementation
source§impl<I: Debug + Display> Error for Error<I>
impl<I: Debug + Display> Error for Error<I>
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
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
impl<I> StructuralPartialEq for Error<I>
Auto Trait Implementations§
impl<I> Freeze for Error<I>where
I: Freeze,
impl<I> RefUnwindSafe for Error<I>where
I: RefUnwindSafe,
impl<I> Send for Error<I>where
I: Send,
impl<I> Sync for Error<I>where
I: Sync,
impl<I> Unpin for Error<I>where
I: Unpin,
impl<I> UnwindSafe for Error<I>where
I: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more