Struct combine::stream::easy::Errors[][src]

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

Struct which hold information about an error that occurred at a specific position. Can hold multiple instances of Error if more that one error occurred 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<I, R, P> Errors<I, R, P>
[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).

Removes 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::parser::range::range;
println!(
    "{}",
    range(&"HTTP"[..])
        .easy_parse("HTT")
        .unwrap_err()
        .map_range(|bytes| format!("{:?}", bytes))
);

Trait Implementations

impl<Item, Range, Position> ParseError<Item, Range, Position> for Errors<Item, Range, Position> where
    Item: PartialEq,
    Range: PartialEq,
    Position: Ord
[src]

Constructs an empty error. Read more

Creates a ParseError from a single Self::StreamError

Sets the position of this ParseError

Merges two errors. If they exist at the same position the errors of other are added to self (using the semantics of add). If they are not at the same position the error furthest ahead are returned, ignoring the other ParseError. Read more

Adds a StreamError to self. Read more

Sets info as the only Expected error of self

Removes any expected errors currently in self

Does a best-effort conversion of self into another ParseError

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

Formats the value using the given formatter. Read more

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

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

This method tests for !=.

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

This method is soft-deprecated. Read more

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

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

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<I, R, P> Send for Errors<I, R, P> where
    I: Send,
    P: Send,
    R: Send

impl<I, R, P> Sync for Errors<I, R, P> where
    I: Sync,
    P: Sync,
    R: Sync