Struct combine::ParseError [] [src]

pub struct ParseError<P, I, R> {
    pub position: P,
    pub errors: Vec<Error<I, R>>,
}

Struct which hold information about an error that occured at a specific position. Can hold multiple instances of Error if more that one error occured in the same position.

Fields

The position where the error occurred

A vector containing specific information on what errors occurred at position. Usually a fully formed message contains one Unexpected error and one or more Expected errors. Message and Other may also appear (combine never generates these errors on its own) and may warrant custom handling.

Methods

impl<P, I, R> ParseError<P, I, R>
[src]

Constructs a new ParseError which occurred at position.

Constructs an error with no other information than the position it occurred at.

Constructs a ParseError with multiple causes.

Constructs an end of input error. Should be returned by parsers which encounter end of input unexpectedly.

Adds an error if error does not exist in this ParseError already (as determined byte PartialEq).

Remvoes all Expected errors in self and adds info instead.

Merges two ParseErrors. If they exist at the same position the errors of other are added to self (using add_error to skip duplicates). If they are not at the same position the error furthest ahead are returned, ignoring the other ParseError.

Maps the position to a new value

Maps all token variants to a new value

Maps all range variants to a new value.

use combine::Parser;
use combine::range::range;
println!(
    "{}",
    range(&"HTTP"[..])
        .parse("HTT")
        .unwrap_err()
        .map_range(|bytes| format!("{:?}", bytes))
);

Trait Implementations

impl<P: Debug, I: Debug, R: Debug> Debug for ParseError<P, I, R>
[src]

Formats the value using the given formatter.

impl<P: PartialEq, I: PartialEq, R: PartialEq> PartialEq for ParseError<P, I, R>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<P, I, R> StdError for ParseError<P, I, R> where
    P: Display + Debug + Any,
    I: Display + Debug + Any,
    R: Display + Debug + Any
[src]

A short description of the error. Read more

The lower-level cause of this error, if any. Read more

impl<P, I, R> Display for ParseError<P, I, R> where
    P: Display,
    I: Display,
    R: Display
[src]

Formats the value using the given formatter. Read more