Enum combine::primitives::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().with(char('.').or(char('a')).or(digit()))
    .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.

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<E, T, R> 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