🛈 Note: This is pre-release documentation for the upcoming tracing 0.2.0 ecosystem.

For the release documentation, please see docs.rs, instead.

pub trait InstrumentError {
    type Instrumented;

    // Required method
    fn in_current_span(self) -> Self::Instrumented;
}
Expand description

Extension trait for instrumenting errors with SpanTraces

Required Associated Types§

source

type Instrumented

The type of the wrapped error after instrumentation

Required Methods§

source

fn in_current_span(self) -> Self::Instrumented

Instrument an Error by bundling it with a SpanTrace

§Examples
use tracing_error::{TracedError, InstrumentError};

fn wrap_error<E>(e: E) -> TracedError<E>
where
    E: std::error::Error + Send + Sync + 'static
{
    e.in_current_span()
}

Implementors§