Trait flex_error::ErrorMessageTracer[][src]

pub trait ErrorMessageTracer {
    fn new_message<E: Display>(message: &E) -> Self;
fn add_message<E: Display>(self, message: &E) -> Self;
fn as_error(&self) -> Option<&(dyn Error + 'static)>; }
Expand description

An ErrorMessageTracer can be used to generically trace any error detail that implements Display.

The error tracer may add backtrace information when the tracing methods are called. However since the error detail is required to only implement Display, any existing error trace may be lost even if the error detail implements Error and contains backtrace, unless the backtrace is serialized in Display.

Required methods

Creates a new error trace, starting from a source error detail that implements Display.

Adds new error detail to an existing trace.

If the std feature is enabled, the error tracer also provides method to optionally converts itself to a dyn Error.

Implementors