Trait ParseError

trait ParseError<I>: Sized

This trait must be implemented by the error type of a nom parser.

There are already implementations of it for (Input, ErrorKind) and Error<Input>.

It provides methods to create an error from some combinators, and combine existing errors in combinators like alt.

Required Methods

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

Creates an error from the input position and an [ErrorKind]

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

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

Creates an error from an input position and an expected character

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

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

Implementors