[−][src]Struct ttk91::error::Error
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]
Kind: Display,
Context: ErrorContext,
Auto Trait Implementations
impl<Kind, Context> RefUnwindSafe for Error<Kind, Context> where
Context: RefUnwindSafe,
Kind: RefUnwindSafe,
Context: RefUnwindSafe,
Kind: RefUnwindSafe,
impl<Kind, Context> Send for Error<Kind, Context> where
Context: Send,
Kind: Send,
Context: Send,
Kind: Send,
impl<Kind, Context> Sync for Error<Kind, Context> where
Context: Sync,
Kind: Sync,
Context: Sync,
Kind: Sync,
impl<Kind, Context> Unpin for Error<Kind, Context> where
Context: Unpin,
Kind: Unpin,
Context: Unpin,
Kind: Unpin,
impl<Kind, Context> UnwindSafe for Error<Kind, Context> where
Context: UnwindSafe,
Kind: UnwindSafe,
Context: UnwindSafe,
Kind: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
[src]
T: Send + Sync + UnwindSafe + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,