tracing_error

Trait InstrumentResult

Source
pub trait InstrumentResult<T> {
    type Instrumented;

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

Extension trait for instrumenting errors in Results with SpanTraces

Required Associated Types§

Source

type Instrumented

The type of the wrapped error after instrumentation

Required Methods§

Source

fn in_current_span(self) -> Result<T, Self::Instrumented>

Instrument an Error by bundling it with a SpanTrace

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


fn do_thing() -> Result<(), TracedError<io::Error>> {
    fallible_fn().in_current_span()
}

Implementations on Foreign Types§

Source§

impl<T, E> InstrumentResult<T> for Result<T, E>
where E: InstrumentError,

Source§

type Instrumented = <E as InstrumentError>::Instrumented

Available on crate feature traced-error only.
Source§

fn in_current_span(self) -> Result<T, Self::Instrumented>

Available on crate feature traced-error only.

Implementors§