Trait nom::error::ParseError
source · pub trait ParseError<I>: Sized {
fn from_error_kind(input: I, kind: ErrorKind) -> Self;
fn append(input: I, kind: ErrorKind, other: Self) -> Self;
fn from_char(input: I, _: char) -> Self { ... }
fn or(self, other: Self) -> Self { ... }
}
Expand description
This trait must be implemented by the error type of a nom parser.
There are already implementations of it for (Input, ErrorKind)
and VerboseError<Input>
.
It provides methods to create an error from some combinators,
and combine existing errors in combinators like alt
.
Required Methods§
sourcefn 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
Provided Methods§
Implementations on Foreign Types§
source§impl<I> ParseError<I> for (I, ErrorKind)
impl<I> ParseError<I> for (I, ErrorKind)
source§impl<I> ParseError<I> for ()
impl<I> ParseError<I> for ()
Implementors§
impl<I> ParseError<I> for Error<I>
impl<I> ParseError<I> for VerboseError<I>
Available on crate feature
alloc
only.