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]

[src]

[src]

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

[src]

Returns the end_of_input error.

[src]

Formats a slice of errors in a human readable way.


let input = r"
  ,123
";
let result = spaces().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]

[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]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

Converts self into a different StreamError type. Read more

[src]

[src]

[src]

[src]

impl<Item, Range, Position> ParseError<Item, Range, Position> for Error<Item, Range> where
    Item: PartialEq,
    Range: PartialEq,
    Position: Default
[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]

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]

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]

[src]

[src]

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

[src]

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

1.0.0
[src]

This method tests for !=.

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

[src]

Performs the conversion.

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

[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