[][src]Struct err_context::Context

pub struct Context<M, E> { /* fields omitted */ }

Additional level of context, wrapping some error inside itself.

This is produced by the context and implements the additional (outer) layer in the chain. Any number of contexts can be chained together.

Methods

impl<M, E> Context<M, E>[src]

pub fn new(msg: M, error: E) -> Self[src]

A direct constructor for the context.

More usually created by the context, but allowing for construction directly without importing the trait.

pub fn into_inner(self) -> E[src]

Extracts the inner error, peeling off the outer layer.

impl<M> Context<M, Compat<Error>>[src]

pub fn from_failure(msg: M, failure: Error) -> Self[src]

Constructor of context from a failure's Error.

This is a compatibility constructor, for wrapping the error of failure. It is enabled by the failure feature.

Warning

The compatibility layer has no way to access the original causes of the failure. Therefore, the inner layers of the provided failure will be lost and the failure will be considered the innermost level.

impl<M, F: Fail> Context<M, Compat<F>>[src]

pub fn from_fail(msg: M, failure: F) -> Self[src]

Constructor of context from a failure's Fail.

This is a compatibility constructor, for wrapping failure. It is enabled by the failure feature.

Warning

The compatibility layer has no way to access the original causes of the failure. Therefore, the inner layers of the provided failure will be lost and the failure will be considered the innermost level.

Trait Implementations

impl<M: Clone, E: Clone> Clone for Context<M, E>[src]

impl<M: Copy, E: Copy> Copy for Context<M, E>[src]

impl<M: Debug, E: Debug> Debug for Context<M, E>[src]

impl<M: Display, E> Display for Context<M, E>[src]

impl<M: Debug + Display, E: Error + 'static> Error for Context<M, E>[src]

Auto Trait Implementations

impl<M, E> Send for Context<M, E> where
    E: Send,
    M: Send

impl<M, E> Unpin for Context<M, E> where
    E: Unpin,
    M: Unpin

impl<M, E> Sync for Context<M, E> where
    E: Sync,
    M: Sync

impl<M, E> UnwindSafe for Context<M, E> where
    E: UnwindSafe,
    M: UnwindSafe

impl<M, E> RefUnwindSafe for Context<M, E> where
    E: RefUnwindSafe,
    M: RefUnwindSafe

Blanket Implementations

impl<E> ErrorExt for E where
    E: Error
[src]

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

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for 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.

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

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

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

impl<T> AsFail for T where
    T: Fail
[src]

impl<E> Fail for E where
    E: 'static + Error + Send + Sync
[src]