pub trait ChainedError:
Error
+ Send
+ 'static {
type ErrorKind;
// Required methods
fn from_kind(kind: Self::ErrorKind) -> Self
where Self: Sized;
fn with_chain<E, K>(error: E, kind: K) -> Self
where Self: Sized,
E: Error + Send + 'static,
K: Into<Self::ErrorKind>;
fn kind(&self) -> &Self::ErrorKind;
fn iter(&self) -> ErrorChainIter<'_> ⓘ;
fn backtrace(&self) -> Option<&Backtrace>;
// Provided method
fn display<'a>(&'a self) -> Display<'a, Self> { ... }
}Expand description
This trait is implemented on all the errors generated by the error_chain
macro.
Required Associated Types§
Required Methods§
Sourcefn from_kind(kind: Self::ErrorKind) -> Selfwhere
Self: Sized,
fn from_kind(kind: Self::ErrorKind) -> Selfwhere
Self: Sized,
Constructs an error from a kind, and generates a backtrace.
Sourcefn with_chain<E, K>(error: E, kind: K) -> Self
fn with_chain<E, K>(error: E, kind: K) -> Self
Constructs a chained error from another error and a kind, and generates a backtrace.
Sourcefn iter(&self) -> ErrorChainIter<'_> ⓘ
fn iter(&self) -> ErrorChainIter<'_> ⓘ
Iterates over the error chain.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.