pub struct ParsingError<I> {
    pub input: I,
    pub error: Cow<'static, str>,
}

Fields§

§input: I§error: Cow<'static, str>

Implementations§

source§

impl<'i> ParsingError<&'i str>

source

pub fn as_bytes(self) -> ParsingError<&'i [u8]>

Trait Implementations§

source§

impl<I> ContextError<I> for ParsingError<I>

source§

fn add_context(_input: I, _ctx: &'static str, other: Self) -> Self

Creates a new error from an input position, a static string and an existing error. This is used mainly in the context combinator, to add user friendly information to errors when backtracking through a parse tree
source§

impl Debug for ParsingError<&[u8]>

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Debug for ParsingError<&str>

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<I> From<(I, &'static str)> for ParsingError<I>

source§

fn from((input, error): (I, &'static str)) -> Self

Converts to this type from the input type.
source§

impl<I> From<(I, String)> for ParsingError<I>

source§

fn from((input, error): (I, String)) -> Self

Converts to this type from the input type.
source§

impl<'i> From<ParsingError<&'i [u8]>> for Error

source§

fn from(val: ParsingError<&'i [u8]>) -> Self

Converts to this type from the input type.
source§

impl<'i> From<ParsingError<&'i [u8]>> for Error<&'i [u8]>

source§

fn from(val: ParsingError<&'i [u8]>) -> Self

Converts to this type from the input type.
source§

impl<'i> From<ParsingError<&'i str>> for Error

source§

fn from(val: ParsingError<&'i str>) -> Self

Converts to this type from the input type.
source§

impl<I, E> FromExternalError<I, E> for ParsingError<I>

source§

fn from_external_error(input: I, kind: ErrorKind, _e: E) -> Self

Creates a new error from an input position, an ErrorKind indicating the wrapping parser, and an external error
source§

impl<I> ParseError<I> for ParsingError<I>

source§

fn from_error_kind(input: I, kind: ErrorKind) -> Self

Creates an error from the input position and an ErrorKind
source§

fn append(input: I, kind: ErrorKind, other: Self) -> Self

Combines an existing error with a new one created from the input position and an ErrorKind. This is useful when backtracking through a parse tree, accumulating error context on the way
source§

fn from_char(input: I, _: char) -> Self

Creates an error from an input position and an expected character
source§

fn or(self, other: Self) -> Self

Combines two existing errors. This function is used to compare errors generated in various branches of alt.
source§

impl<I: PartialEq> PartialEq<ParsingError<I>> for ParsingError<I>

source§

fn eq(&self, other: &ParsingError<I>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<I: Eq> Eq for ParsingError<I>

source§

impl<I> StructuralEq for ParsingError<I>

source§

impl<I> StructuralPartialEq for ParsingError<I>

Auto Trait Implementations§

§

impl<I> RefUnwindSafe for ParsingError<I>where I: RefUnwindSafe,

§

impl<I> Send for ParsingError<I>where I: Send,

§

impl<I> Sync for ParsingError<I>where I: Sync,

§

impl<I> Unpin for ParsingError<I>where I: Unpin,

§

impl<I> UnwindSafe for ParsingError<I>where I: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<I> IntoError for Iwhere I: Into<Error>,

source§

fn set_err_summary<M>(self, msg: M) -> Errorwhere M: Into<Cow<'static, str>>,

source§

fn set_err_details<M>(self, msg: M) -> Errorwhere M: Into<Cow<'static, str>>,

source§

fn set_err_kind(self, kind: ErrorKind) -> Error

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.