[−][src]Enum combine::easy::Error
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
Variant for containing other types of errors
Implementations
impl<T, R> Error<T, R>
[src]
pub fn map_token<F, U>(self, f: F) -> Error<U, R> where
F: FnOnce(T) -> U,
[src]
F: FnOnce(T) -> U,
pub fn map_range<F, S>(self, f: F) -> Error<T, S> where
F: FnOnce(R) -> S,
[src]
F: FnOnce(R) -> S,
impl<T, R> Error<T, R>
[src]
pub fn end_of_input() -> Error<T, R>
[src]
Returns the end_of_input
error.
pub fn fmt_errors(errors: &[Error<T, R>], f: &mut Formatter) -> Result where
T: Display,
R: Display,
[src]
T: Display,
R: Display,
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(position::Stream::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: Display, R: Display> Display for Error<T, R>
[src]
impl<T, R, E> From<E> for Error<T, R> where
E: StdError + 'static + Send + Sync,
[src]
E: StdError + 'static + Send + Sync,
impl<Item, Range, Position> ParseError<Item, Range, Position> for Error<Item, Range> where
Item: PartialEq,
Range: PartialEq,
Position: Default,
[src]
Item: PartialEq,
Range: PartialEq,
Position: Default,
type StreamError = Self
fn empty(_: Position) -> Self
[src]
fn from_error(_: Position, err: Self::StreamError) -> Self
[src]
fn set_position(&mut self, _position: Position)
[src]
fn add(&mut self, err: Self::StreamError)
[src]
fn set_expected<F>(self_: &mut Tracked<Self>, info: Self::StreamError, f: F) where
F: FnOnce(&mut Tracked<Self>),
[src]
F: FnOnce(&mut Tracked<Self>),
fn is_unexpected_end_of_input(&self) -> bool
[src]
fn into_other<T>(self) -> T where
T: ParseError<Item, Range, Position>,
[src]
T: ParseError<Item, Range, Position>,
fn merge(self, other: Self) -> Self
[src]
fn add_expected<E>(&mut self, info: E) where
E: for<'s> ErrorInfo<'s, Item, Range>,
[src]
E: for<'s> ErrorInfo<'s, Item, Range>,
fn add_unexpected<E>(&mut self, info: E) where
E: for<'s> ErrorInfo<'s, Item, Range>,
[src]
E: for<'s> ErrorInfo<'s, Item, Range>,
fn add_message<E>(&mut self, info: E) where
E: for<'s> ErrorInfo<'s, Item, Range>,
[src]
E: for<'s> ErrorInfo<'s, Item, Range>,
fn clear_expected(&mut self)
[src]
impl<T: PartialEq, R: PartialEq> PartialEq<Error<T, R>> for Error<T, R>
[src]
fn eq(&self, other: &Error<T, R>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<Item, Range> StreamError<Item, Range> for Error<Item, Range> where
Item: PartialEq,
Range: PartialEq,
[src]
Item: PartialEq,
Range: PartialEq,
fn unexpected_token(token: Item) -> Self
[src]
fn unexpected_range(token: Range) -> Self
[src]
fn unexpected_format<T>(msg: T) -> Self where
T: Display,
[src]
T: Display,
fn unexpected_static_message(msg: &'static str) -> Self
[src]
fn expected_token(token: Item) -> Self
[src]
fn expected_range(token: Range) -> Self
[src]
fn expected_format<T>(msg: T) -> Self where
T: Display,
[src]
T: Display,
fn expected_static_message(msg: &'static str) -> Self
[src]
fn message_format<T>(msg: T) -> Self where
T: Display,
[src]
T: Display,
fn message_static_message(msg: &'static str) -> Self
[src]
fn message_token(token: Item) -> Self
[src]
fn message_range(token: Range) -> Self
[src]
fn is_unexpected_end_of_input(&self) -> bool
[src]
fn other<E>(err: E) -> Self where
E: StdError + Send + Sync + 'static,
[src]
E: StdError + Send + Sync + 'static,
fn into_other<T>(self) -> T where
T: StreamError<Item, Range>,
[src]
T: StreamError<Item, Range>,
fn unexpected<E>(info: E) -> Self where
E: for<'s> ErrorInfo<'s, Item, Range>,
[src]
E: for<'s> ErrorInfo<'s, Item, Range>,
fn expected<E>(info: E) -> Self where
E: for<'s> ErrorInfo<'s, Item, Range>,
[src]
E: for<'s> ErrorInfo<'s, Item, Range>,
fn message<E>(info: E) -> Self where
E: for<'s> ErrorInfo<'s, Item, Range>,
[src]
E: for<'s> ErrorInfo<'s, Item, Range>,
fn end_of_input() -> Self
[src]
Auto Trait Implementations
impl<T, R> !RefUnwindSafe for Error<T, R>
impl<T, R> Send for Error<T, R> where
R: Send,
T: Send,
R: Send,
T: Send,
impl<T, R> Sync for Error<T, R> where
R: Sync,
T: Sync,
R: Sync,
T: Sync,
impl<T, R> Unpin for Error<T, R> where
R: Unpin,
T: Unpin,
R: Unpin,
T: Unpin,
impl<T, R> !UnwindSafe for Error<T, R>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<!> for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,