[][src]Struct ttk91::error::Error

pub struct Error<Kind, Context> { /* fields omitted */ }

An error that has a Kind and optional list of Context instances.

The Kind represents the original root cause of the error, whereas the Context type provides additional information.

Implementations

impl<Kind, Context> Error<Kind, Context>[src]

pub fn new<T: Into<Kind>>(kind: T) -> Error<Kind, Context>[src]

Creates a new Error of the desired kind. The created error contains no additional context information.

pub fn context<T: Into<Context>>(self, ctx: T) -> Self[src]

Adds context to the error.

impl<K, T> Error<ErrorKind<K, T>, Context>[src]

pub fn end_of_stream() -> ParseError<K, T>[src]

Creates a new ParseError with the kind ErrorKind::EndOfStream.

pub fn unexpected(span: Span, got: T, expected: String) -> ParseError<K, T>[src]

Creates a new ParseError with the kind ErrorKind::UnexpectedToken.

pub fn other(span: Span, kind: K) -> ParseError<K, T>[src]

Creates a new ParseError from an parser of format specific error type. The returned parse error will have a kind of ErrorKind::Other, with the kind set to the provided value.

pub fn span(&self) -> Option<&Span>[src]

Returns the location of the error relative to the start of the input stream if known.

Trait Implementations

impl<Kind: Clone, Context: Clone> Clone for Error<Kind, Context>[src]

impl<Kind: Debug, Context: Debug> Debug for Error<Kind, Context>[src]

impl<Kind, Context> Display for Error<Kind, Context> where
    Kind: Display,
    Context: ErrorContext
[src]

Auto Trait Implementations

impl<Kind, Context> RefUnwindSafe for Error<Kind, Context> where
    Context: RefUnwindSafe,
    Kind: RefUnwindSafe

impl<Kind, Context> Send for Error<Kind, Context> where
    Context: Send,
    Kind: Send

impl<Kind, Context> Sync for Error<Kind, Context> where
    Context: Sync,
    Kind: Sync

impl<Kind, Context> Unpin for Error<Kind, Context> where
    Context: Unpin,
    Kind: Unpin

impl<Kind, Context> UnwindSafe for Error<Kind, Context> where
    Context: UnwindSafe,
    Kind: 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.