[−][src]Trait flatzinc::ParseError
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
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, other: Self) -> Self
combines two existing error. This function is used to compare errors generated in various branches of alt
fn add_context(_input: I, _ctx: &'static str, other: Self) -> Self
create 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
Implementations on Foreign Types
impl<I> ParseError<I> for ()
[src]
impl<I> ParseError<I> for (I, ErrorKind)
[src]
fn from_error_kind(input: I, kind: ErrorKind) -> (I, ErrorKind)
[src]
fn append(I, ErrorKind, other: (I, ErrorKind)) -> (I, ErrorKind)
[src]
Implementors
impl<I> ParseError<I> for VerboseError<I>
[src]
fn from_error_kind(input: I, kind: ErrorKind) -> VerboseError<I>
[src]
fn append(input: I, kind: ErrorKind, other: VerboseError<I>) -> VerboseError<I>
[src]
fn from_char(input: I, c: char) -> VerboseError<I>
[src]
fn add_context(
input: I,
ctx: &'static str,
other: VerboseError<I>
) -> VerboseError<I>
[src]
input: I,
ctx: &'static str,
other: VerboseError<I>
) -> VerboseError<I>