[][src]Enum ttk91::parsing::ErrorKind

pub enum ErrorKind<K, T> {
    EndOfStream,
    TrailingInput,
    UnexpectedToken {
        span: Span,
        expected: Vec<String>,
        got: T,
    },
    Other {
        span: Span,
        kind: K,
    },
}

Common error cases for parsing. Cases specific to the format being parsed can be defined via the K type parameter.

Variants

EndOfStream

The parser encountered an unexpected end of the input stream.

TrailingInput

The parser finished successfully, but there was unconsumed data left in the input stream.

UnexpectedToken

The parser encountered an token which it did not expect.

Fields of UnexpectedToken

span: Span

Location of the token in the input stream.

expected: Vec<String>

List of user facing descriptions of the types of tokens that were expected.

Should contain phrases like a register or an instruction, that can be used in a phrase like expected [a register] or [an instruction].

got: T

The token that was unexpectedly encountered.

Other

Parser or format specific error.

Fields of Other

span: Span

Location where the error occurred.

kind: K

Type of the error. Usually an enum.

Trait Implementations

impl<K: Clone, T: Clone> Clone for ErrorKind<K, T>[src]

impl<K: Debug, T: Debug> Debug for ErrorKind<K, T>[src]

impl<K, T> Display for ErrorKind<K, T> where
    K: Display,
    T: Display
[src]

impl<K: PartialEq, T: PartialEq> PartialEq<ErrorKind<K, T>> for ErrorKind<K, T>[src]

impl<K, T> StructuralPartialEq for ErrorKind<K, T>[src]

Auto Trait Implementations

impl<K, T> RefUnwindSafe for ErrorKind<K, T> where
    K: RefUnwindSafe,
    T: RefUnwindSafe

impl<K, T> Send for ErrorKind<K, T> where
    K: Send,
    T: Send

impl<K, T> Sync for ErrorKind<K, T> where
    K: Sync,
    T: Sync

impl<K, T> Unpin for ErrorKind<K, T> where
    K: Unpin,
    T: Unpin

impl<K, T> UnwindSafe for ErrorKind<K, T> where
    K: UnwindSafe,
    T: UnwindSafe

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> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.