pub trait Annotatable: Sized {
// Required method
fn merge_annotation<I>(ea: ErrorAnnotation<Self, I>) -> Self
where I: Display;
}Expand description
An Annotatable error type is can convert an ErrorAnnotation with Self as the source type
back into Self, provided the annotated info implements std::fmt::Display.
A prime example is the std::io::Error impl, which can be used to convert any annotation on a
std::io::Error back into a std::io::Error, as the crate-level example demonstrates.
The conversion provided by implementations of Annotatable is typically conveniently
accomplished via AnnotateResult::annotate_err_into.
Required Methods§
fn merge_annotation<I>(ea: ErrorAnnotation<Self, I>) -> Selfwhere
I: Display,
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.