Trait snafu::ErrorCompat
source · pub trait ErrorCompat {
// Provided methods
fn backtrace(&self) -> Option<&Backtrace> { ... }
fn iter_chain(&self) -> ChainCompat<'_> ⓘ
where Self: AsErrorSource { ... }
}
Expand description
Backports changes to the Error
trait to
versions of Rust lacking them.
It is recommended to always call these methods explicitly so that it is easy to replace usages of this trait when you start supporting a newer version of Rust.
ErrorCompat::backtrace(&error); // Recommended
error.backtrace(); // Discouraged
Provided Methods§
sourcefn iter_chain(&self) -> ChainCompat<'_> ⓘwhere
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_> ⓘwhere
Self: AsErrorSource,
Returns an iterator for traversing the chain of errors,
starting with the current error
and continuing with recursive calls to Error::source
.
To omit the current error and only traverse its sources,
use skip(1)
.
Object Safety§
This trait is not object safe.