pub struct Context<D: Display + Send + Sync + 'static> { /* private fields */ }
Expand description

An error with context around it.

The context is intended to be a human-readable, user-facing explanation for the error that has occurred. The underlying error is not assumed to be end-user-relevant information.

The Display impl for Context only prints the human-readable context, while the Debug impl also prints the underlying error.

Implementations

Creates a new context without an underlying error message.

Returns a reference to the context provided with this error.

Maps Context<D> to Context<T> by applying a function to the contained context.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Returns the “name” of the error. Read more

Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more

Returns a reference to the Backtrace carried by this failure, if it carries one. Read more

Provides context for this failure. Read more

Wraps this failure in a compatibility wrapper that implements std::error::Error. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.