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
Unexpected(Info<T, R>)Error indicating an unexpected token has been encountered in the stream
Expected(Info<T, R>)Error indicating that the parser expected something else
Message(Info<T, R>)Generic message
Other(Box<StdError + Send + Sync>)Variant for containing other types of errors
Methods
impl<T, R> Error<T, R>[src]
fn map_token<F, U>(self, f: F) -> Error<U, R> where
F: FnOnce(T) -> U,
F: FnOnce(T) -> U,
fn map_range<F, S>(self, f: F) -> Error<T, S> where
F: FnOnce(R) -> S,
F: FnOnce(R) -> S,
impl<T, R> Error<T, R>[src]
fn end_of_input() -> Error<T, R>
Returns the end_of_input error.
fn fmt_errors(errors: &[Error<T, R>], f: &mut Formatter) -> Result where
T: Display,
R: Display,
T: Display,
R: Display,
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]
impl<T: PartialEq, R: PartialEq> PartialEq for Error<T, R>[src]
fn eq(&self, other: &Error<T, R>) -> bool
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0
This method tests for !=.
impl<E, T, R> From<E> for Error<T, R> where
E: StdError + 'static + Send + Sync, [src]
E: StdError + 'static + Send + Sync,