Enum combine::stream::easy::Error[][src]

pub enum Error<T, R> {
    Unexpected(Info<T, R>),
    Expected(Info<T, R>),
    Message(Info<T, R>),
    Other(Box<StdError + Send + Sync>),
}

Enum used to store information about an error that has occurred during parsing.

Variants

Error indicating an unexpected token has been encountered in the stream

Error indicating that the parser expected something else

Generic message

Variant for containing other types of errors

Methods

impl<T, R> Error<T, R>
[src]

impl<T, R> Error<T, R>
[src]

Returns the end_of_input error.

Formats a slice of errors in a human readable way.


let input = r"
  ,123
";
let result = spaces().silent().with(char('.').or(char('a')).or(digit()))
    .easy_parse(State::new(input));
let m = format!("{}", result.unwrap_err());
let expected = r"Parse error at line: 2, column: 3
Unexpected `,`
Expected `.`, `a` or `digit`
";
assert_eq!(m, expected);

Trait Implementations

impl<T: Debug, R: Debug> Debug for Error<T, R>
[src]

Formats the value using the given formatter. Read more

impl<Item, Range> StreamError<Item, Range> for Error<Item, Range> where
    Item: PartialEq,
    Range: PartialEq
[src]

Converts self into a different StreamError type. Read more

impl<Item, Range, Position> ParseError<Item, Range, Position> for Error<Item, Range> where
    Item: PartialEq,
    Range: PartialEq,
    Position: Default
[src]

Constructs an empty error. Read more

Creates a ParseError from a single Self::StreamError

Sets the position of this ParseError

Adds a StreamError to self. Read more

Sets info as the only Expected error of self

Does a best-effort conversion of self into another 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

Removes any expected errors currently in self

impl<T: PartialEq, R: PartialEq> PartialEq for Error<T, R>
[src]

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

This method tests for !=.

impl<T, R, E> From<E> for Error<T, R> where
    E: StdError + 'static + Send + Sync
[src]

Performs the conversion.

impl<T: Display, R: Display> Display for Error<T, R>
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<T, R> Send for Error<T, R> where
    R: Send,
    T: Send

impl<T, R> Sync for Error<T, R> where
    R: Sync,
    T: Sync