pub trait AnnotateErrorOrigin: 'static + Send + Sync + Error {
    // Required method
    fn with_origin(self, origin: &'static str) -> Self;
}
Expand description

A trait to support the origin annotation such that errors across subsystems can be easier tracked.

Required Methods§

source

fn with_origin(self, origin: &'static str) -> Self

Annotate the error with a origin str.

Commonly this is used to create nested enum variants.

E::WithOrigin("I am originally from Cowtown.", E::Variant)

Implementors§