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 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<I, R, P> Errors<I, R, P>
[src]

[src]

Constructs a new ParseError which occurred at position.

[src]

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

[src]

Constructs a ParseError with multiple causes.

[src]

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

[src]

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

[src]

Remvoes all Expected errors in self and adds info instead.

[src]

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.

[src]

Maps the position to a new value

[src]

Maps all token variants to a new value

[src]

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]

[src]

Constructs an empty error. Read more

[src]

Creates a ParseError from a single Self::StreamError

[src]

Sets the position of this ParseError

[src]

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

[src]

Adds a StreamError to self. Read more

[src]

Sets info as the only Expected error of self

[src]

[src]

Does a best-effort conversion of self into another ParseError

[src]

[src]

[src]

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

[src]

Formats the value using the given formatter.

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

[src]

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

[src]

This method tests for !=.

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

[src]

A short description of the error. Read more

1.0.0
[src]

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]

[src]

Formats the value using the given formatter. Read more