ResultSpanExt

Trait ResultSpanExt 

Source
pub trait ResultSpanExt<T, E> {
    // Required methods
    fn with_current_span(self) -> BoxedComposableResult<T, E>;
    fn with_span(self, span: &Span) -> BoxedComposableResult<T, E>;
}
Expand description

Extension trait for Result types to add span context to errors.

Required Methods§

Source

fn with_current_span(self) -> BoxedComposableResult<T, E>

Adds the current span’s context to an error.

§Example
use error_rail::async_ext::ResultSpanExt;

fn process() -> BoxedComposableResult<Data, ProcessError> {
    do_work().with_current_span()
}
Source

fn with_span(self, span: &Span) -> BoxedComposableResult<T, E>

Adds a specific span’s context to an error.

Implementations on Foreign Types§

Source§

impl<T, E> ResultSpanExt<T, E> for Result<T, E>

Implementors§