pub trait FutureErrorContext: Future + Sized {
    // Required methods
    fn context<D>(self, context: D) -> ContextFut<Self, D>
       where D: Display + Send + Sync + 'static;
    fn with_context<D, F>(self, f: F) -> WithContextFut<Self, F>
       where D: Display + Send + Sync + 'static,
             F: FnOnce() -> D;
}
Expand description

“Context” support for futures.

Required Methods§

source

fn context<D>(self, context: D) -> ContextFut<Self, D>
where D: Display + Send + Sync + 'static,

Add context to the error returned by this future

source

fn with_context<D, F>(self, f: F) -> WithContextFut<Self, F>
where D: Display + Send + Sync + 'static, F: FnOnce() -> D,

Add context created by provided function to the error returned by this future

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<F, E> FutureErrorContext for F
where F: Future<Error = E> + Sized, E: Into<Error>,