Trait rocket::mtls::oid::asn1_rs::nom::error::ParseError

source ·
pub trait ParseError<I>: Sized {
    // Required methods
    fn from_error_kind(input: I, kind: ErrorKind) -> Self;
    fn append(input: I, kind: ErrorKind, other: Self) -> Self;

    // Provided methods
    fn from_char(input: I, _: char) -> Self { ... }
    fn or(self, other: Self) -> Self { ... }
}
Available on crate feature mtls only.
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§

source

fn from_error_kind(input: I, kind: ErrorKind) -> Self

Creates an error from the input position and an ErrorKind

source

fn append(input: I, kind: 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

Provided Methods§

source

fn from_char(input: I, _: char) -> Self

Creates an error from an input position and an expected character

source

fn or(self, other: Self) -> Self

Combines two existing errors. This function is used to compare errors generated in various branches of alt.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<I> ParseError<I> for (I, ErrorKind)

source§

fn from_error_kind(input: I, kind: ErrorKind) -> (I, ErrorKind)

source§

fn append(_: I, _: ErrorKind, other: (I, ErrorKind)) -> (I, ErrorKind)

source§

impl<I> ParseError<I> for ()

Implementors§

source§

impl<'a> ParseError<&'a [u8]> for rocket::mtls::x509::der_parser::asn1_rs::Error

source§

impl<I> ParseError<I> for X509Error

source§

impl<I> ParseError<I> for rocket::mtls::x509::der_parser::asn1_rs::nom::error::Error<I>

source§

impl<I> ParseError<I> for VerboseError<I>