pub trait ErrorEnvelope:
ErrorContext
+ Debug
+ Display {
type Kind: ErrorKind;
type Envelope<K: ErrorKind>: ErrorEnvelope;
// Required methods
fn convert<K>(self) -> Self::Envelope<K>
where K: ErrorKind + From<Self::Kind>;
fn error_kind(&self) -> Self::Kind;
fn new(error_kind: Self::Kind) -> Self;
fn with_description<S>(error_kind: Self::Kind, description: S) -> Self
where S: StaticString;
}Expand description
Required Associated Types§
Sourcetype Envelope<K: ErrorKind>: ErrorEnvelope
type Envelope<K: ErrorKind>: ErrorEnvelope
How to map one ErrorKind to another within this envelope.
Required Methods§
Sourcefn convert<K>(self) -> Self::Envelope<K>
fn convert<K>(self) -> Self::Envelope<K>
Converts the underlying error kind into a compatible error kind.
Sourcefn error_kind(&self) -> Self::Kind
fn error_kind(&self) -> Self::Kind
The error kind held within this envelope.
Sourcefn with_description<S>(error_kind: Self::Kind, description: S) -> Selfwhere
S: StaticString,
fn with_description<S>(error_kind: Self::Kind, description: S) -> Selfwhere
S: StaticString,
Constructs a new envelope with the provided error_kind and description.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl<K: ErrorKind> ErrorEnvelope for Described<K>
Available on crate feature alloc only.
impl<K: ErrorKind> ErrorEnvelope for Described<K>
Available on crate feature
alloc only.Source§impl<K: ErrorKind> ErrorEnvelope for Diagnostic<K>
Available on crate feature alloc only.
impl<K: ErrorKind> ErrorEnvelope for Diagnostic<K>
Available on crate feature
alloc only.