Struct Error

pub struct Error<I> { pub input: I, pub code: ErrorKind }

default error type, only contains the error's location and code

Fields

input: I

position of the error in the input data

code: ErrorKind

nom error code

Implementations

impl<I> Error<I>

fn new(input: I, code: ErrorKind) -> Error<I>

creates a new basic error

impl<I: Copy> Error<&I>

fn copied(self) -> Error<I>

Converts Error<&I> into Error<I> by copying.

impl<I: Copy> Error<&mut I>

fn copied(self) -> Error<I>

Converts Error<&mut I> into Error<I> by copying.

impl<I: ToOwned + ?Sized> Error<&I>

fn cloned(self) -> Error<I::Owned>

Converts Error<&I> into Error<I::Owned> by cloning.

impl<I: ToOwned + ?Sized> Error<&mut I>

fn cloned(self) -> Error<I::Owned>

Converts Error<&mut I> into Error<I::Owned> by cloning.

Trait Implementations

impl From<Error<&[u8]>> for Error<Vec<u8>>

fn from(value: Error<&[u8]>) -> Self

impl From<Error<&str>> for Error<String>

fn from(value: Error<&str>) -> Self

impl<I> ContextError<I> for Error<I>

impl<I> ErrorConvert<Error<(I, usize)>> for Error<I>

fn convert(self) -> Error<(I, usize)>

impl<I> ErrorConvert<Error<I>> for Error<(I, usize)>

fn convert(self) -> Error<I>

impl<I> ParseError<I> for Error<I>

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

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

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

Create a new error from an input position and an external error

impl<I: Clone> Clone for Error<I>

fn clone(&self) -> Self

impl<I: Debug + Display> Error for Error<I>

impl<I: Debug> Debug for Error<I>

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

impl<I: Display> Display for Error<I>

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

impl<I: Eq> Eq for Error<I>

impl<I: PartialEq> PartialEq for Error<I>

fn eq(&self, other: &Self) -> bool

impl<I: PartialEq> StructuralPartialEq for Error<I>

Auto Trait Implementations

impl<I> Freeze for Error<I> where I: Freeze,

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

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

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

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

impl<I> UnsafeUnpin for Error<I> where I: UnsafeUnpin,

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

Blanket Implementations

impl<T> Any for Error<I> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Error<I> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Error<I> where T: ?Sized,

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

impl<T> CloneToUninit for Error<I> where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for Error<I>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Error<I> where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T> ToString for Error<I> where T: Display + ?Sized,

fn to_string(&self) -> String

impl<T, U> Into<U> for Error<I> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom<U> for Error<I> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for Error<I> where U: TryFrom<T>,

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