[][src]Enum arithmetic_parser::ErrorKind

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

Parsing error kind.

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.

LiteralName

Literal is used where a name is expected, e.g., as a function identifier.

An example of input triggering this error is 1(2, x); 1 is used as the function identifier.

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<Context>

Parsing context.

UnexpectedTerm

Unexpected expression end.

Fields of UnexpectedTerm

context: Option<Context>

Parsing context.

Leftovers

Leftover symbols after parsing.

Incomplete

Input is incomplete.

UnfinishedComment

Unfinished comment.

ChainedComparison

Chained comparison, such as 1 < 2 < 3.

Other

Other parsing error.

Fields of Other

kind: NomErrorKind

nom-defined error kind.

context: Option<Context>

Parsing context.

Implementations

impl ErrorKind[src]

pub fn literal<T: Into<Error>>(error: T) -> Self[src]

Creates a Literal variant with the specified error.

pub fn context(&self) -> Option<Context>[src]

Returns optional error context.

pub fn is_incomplete(&self) -> bool[src]

Returns true if this is Incomplete.

Trait Implementations

impl Debug for ErrorKind[src]

impl Display for ErrorKind[src]

impl Error for ErrorKind[src]

impl<'a> FromExternalError<LocatedSpan<&'a str, ()>, ErrorKind> for Error<'a>[src]

Auto Trait Implementations

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> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

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

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

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

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

impl<T> TryConv for T

impl<T> TryConv for T

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.