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]
impl<T, R> Error<T, R>
pub fn map_token<F, U>(self, f: F) -> Error<U, R> where
F: FnOnce(T) -> U,
[src]
pub fn map_token<F, U>(self, f: F) -> Error<U, R> where
F: FnOnce(T) -> U,
pub fn map_range<F, S>(self, f: F) -> Error<T, S> where
F: FnOnce(R) -> S,
[src]
pub fn map_range<F, S>(self, f: F) -> Error<T, S> where
F: FnOnce(R) -> S,
impl<T, R> Error<T, R>
[src]
impl<T, R> Error<T, R>
pub fn end_of_input() -> Error<T, R>
[src]
pub fn end_of_input() -> Error<T, R>
Returns the end_of_input
error.
pub fn fmt_errors(errors: &[Error<T, R>], f: &mut Formatter) -> Result where
T: Display,
R: Display,
[src]
pub fn fmt_errors(errors: &[Error<T, R>], f: &mut Formatter) -> Result where
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: Debug, R: Debug> Debug for Error<T, R>
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: PartialEq, R: PartialEq> PartialEq for Error<T, R>
[src]
impl<T: PartialEq, R: PartialEq> PartialEq for Error<T, R>
fn eq(&self, other: &Error<T, R>) -> bool
[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) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]This method tests for !=
.
impl<E, T, R> From<E> for Error<T, R> where
E: StdError + 'static + Send + Sync,
[src]
impl<E, T, R> From<E> for Error<T, R> where
E: StdError + 'static + Send + Sync,
impl<T: Display, R: Display> Display for Error<T, R>
[src]
impl<T: Display, R: Display> Display for Error<T, R>