[−][src]Struct err_context::Context
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,
E: Send,
M: Send,
impl<M, E> Unpin for Context<M, E> where
E: Unpin,
M: Unpin,
E: Unpin,
M: Unpin,
impl<M, E> Sync for Context<M, E> where
E: Sync,
M: Sync,
E: Sync,
M: Sync,
impl<M, E> UnwindSafe for Context<M, E> where
E: UnwindSafe,
M: UnwindSafe,
E: UnwindSafe,
M: UnwindSafe,
impl<M, E> RefUnwindSafe for Context<M, E> where
E: RefUnwindSafe,
M: RefUnwindSafe,
E: RefUnwindSafe,
M: RefUnwindSafe,
Blanket Implementations
impl<E> ErrorExt for E where
E: Error,
[src]
E: Error,
fn context<M>(Self, M) -> Context<M, E> where
M: Display,
[src]
M: Display,
ⓘImportant traits for Chain<'a>fn chain(&Self) -> Chain where
E: 'static,
[src]
E: 'static,
fn find_source<T: Error + 'static>(&self) -> Option<&T> where
Self: 'static,
[src]
Self: 'static,
fn display<S: Display>(&self, separator: S) -> DisplayChain<S> where
Self: 'static,
[src]
Self: 'static,
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, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AsFail for T where
T: Fail,
[src]
T: Fail,
impl<E> Fail for E where
E: 'static + Error + Send + Sync,
[src]
E: 'static + Error + Send + Sync,