rustmax::nom::error

Struct Error

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

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§

Source§

impl<I> Error<I>

Source

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

creates a new basic error

Source§

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

Source

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

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

Source§

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

Source

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

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

Source§

impl<I> Error<&I>
where I: Copy,

Source

pub fn copied(self) -> Error<I>

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

Source§

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

Source

pub fn copied(self) -> Error<I>

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

Trait Implementations§

Source§

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

Source§

fn clone(&self) -> Error<I>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<I> ContextError<I> for Error<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<I> Debug for Error<I>
where I: Debug,

Source§

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

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

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

The Display implementation allows the std::error::Error implementation

Source§

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

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

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

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

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

Source§

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

Transform to another error type
Source§

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

Source§

fn convert(self) -> Error<I>

Transform to another error type
Source§

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

Source§

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

Converts to this type from the input type.
Source§

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

Source§

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

Converts to this type from the input type.
Source§

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

Source§

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

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

Source§

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

Source§

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

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

fn append(_: I, _: ErrorKind, other: Error<I>) -> Error<I>

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 for Error<I>
where I: PartialEq,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

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

Source§

impl<I> 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> UnwindSafe for Error<I>
where I: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

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

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

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

Source§

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

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where 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> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where 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<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> QuickClone<T> for T
where T: Clone,

Source§

fn C(&self) -> T

Source§

impl<T> QuickToOwned for T
where T: ToOwned,

Source§

type Owned = <T as ToOwned>::Owned

Source§

fn O(&self) -> <T as QuickToOwned>::Owned

Source§

impl<T> QuickToString for T
where T: ToString + ?Sized,

Source§

fn S(&self) -> String

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T