Enum cexpr::nom::Err
[−]
pub enum Err<P, E = u32> { Code(ErrorKind<E>), Node(ErrorKind<E>, Box<Err<P, E>>), Position(ErrorKind<E>, P), NodePosition(ErrorKind<E>, P, Box<Err<P, E>>), }
Contains the error that a parser can return
It can represent a linked list of errors, indicating the path taken in the parsing tree, with corresponding position in the input data. It depends on P, the input position (for a &[u8] parser, it would be a &[u8]), and E, the custom error type (by default, u32)
Variants
Code(ErrorKind<E>)
An error code, represented by an ErrorKind, which can contain a custom error code represented by E
Node(ErrorKind<E>, Box<Err<P, E>>)
An error code, and the next error
Position(ErrorKind<E>, P)
An error code, and the input position
NodePosition(ErrorKind<E>, P, Box<Err<P, E>>)
An error code, the input position and the next error
Trait Implementations
impl<P, E> Clone for Err<P, E> where E: Clone, P: Clone
fn clone(&self) -> Err<P, E>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<P, E> Eq for Err<P, E> where E: Eq, P: Eq
impl<P, E> PartialEq<Err<P, E>> for Err<P, E> where E: PartialEq<E>, P: PartialEq<P>
fn eq(&self, __arg_0: &Err<P, E>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Err<P, E>) -> bool
This method tests for !=
.
impl<P, E> Debug for Err<P, E> where E: Debug, P: Debug
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.