[][src]Enum arithmetic_parser::Error

#[non_exhaustive]pub enum Error<'a> {
    NonAsciiInput,
    Literal(Error),
    Type(Error),
    UnsupportedOp(Op),
    UnexpectedChar {
        context: Option<Spanned<'a, Context>>,
    },
    UnexpectedTerm {
        context: Option<Spanned<'a, Context>>,
    },
    Leftovers,
    Incomplete,
    Other {
        kind: ErrorKind,
        context: Option<Spanned<'a, Context>>,
    },
}

Parsing error.

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
NonAsciiInput

Input is not in ASCII.

Literal(Error)

Error parsing literal.

Type(Error)

Error parsing type hint.

UnsupportedOp(Op)

Unary or binary operation switched off in the parser features.

UnexpectedChar

No rules where expecting this character.

Fields of UnexpectedChar

context: Option<Spanned<'a, Context>>

Parsing context.

UnexpectedTerm

Unexpected expression end.

Fields of UnexpectedTerm

context: Option<Spanned<'a, Context>>

Parsing context.

Leftovers

Leftover symbols after parsing.

Incomplete

Input is incomplete.

Other

Other parsing error.

Fields of Other

kind: ErrorKind

nom-defined error kind.

context: Option<Spanned<'a, Context>>

Parsing context.

Implementations

impl<'_> Error<'_>[src]

pub fn without_context(self) -> Error<'static>[src]

Removes the context from this error, thus extending its lifetime.

impl<'a> Error<'a>[src]

pub fn context(&self) -> Option<Spanned<'_, Context>>[src]

Returns optional error context.

Trait Implementations

impl<'a> Debug for Error<'a>[src]

impl<'_> Display for Error<'_>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Error<'a>

impl<'a> Send for Error<'a>

impl<'a> Sync for Error<'a>

impl<'a> Unpin for Error<'a>

impl<'a> UnwindSafe for Error<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.