pub trait FutureExt: Future + Sized {
    fn attach<A>(self, attachment: A) -> FutureWithAttachment<Self, A>Notable traits for FutureWithAttachment<Fut, T>impl<Fut, T> Future for FutureWithAttachment<Fut, T> where
    Fut: Future,
    Fut::Output: ResultExt,
    T: Send + Sync + 'static, 
type Output = Fut::Output;

    where
        A: Send + Sync + 'static
; fn attach_lazy<A, F>(
        self,
        attachment: F
    ) -> FutureWithLazyAttachment<Self, F>Notable traits for FutureWithLazyAttachment<Fut, F>impl<Fut, F, T> Future for FutureWithLazyAttachment<Fut, F> where
    Fut: Future,
    Fut::Output: ResultExt,
    F: FnOnce() -> T,
    T: Send + Sync + 'static, 
type Output = Fut::Output;

    where
        A: Send + Sync + 'static,
        F: FnOnce() -> A
; fn attach_printable<A>(
        self,
        attachment: A
    ) -> FutureWithPrintableAttachment<Self, A>Notable traits for FutureWithPrintableAttachment<Fut, T>impl<Fut, T> Future for FutureWithPrintableAttachment<Fut, T> where
    Fut: Future,
    Fut::Output: ResultExt,
    T: Display + Debug + Send + Sync + 'static, 
type Output = Fut::Output;

    where
        A: Display + Debug + Send + Sync + 'static
; fn attach_printable_lazy<A, F>(
        self,
        attachment: F
    ) -> FutureWithLazyPrintableAttachment<Self, F>Notable traits for FutureWithLazyPrintableAttachment<Fut, F>impl<Fut, F, T> Future for FutureWithLazyPrintableAttachment<Fut, F> where
    Fut: Future,
    Fut::Output: ResultExt,
    F: FnOnce() -> T,
    T: Display + Debug + Send + Sync + 'static, 
type Output = Fut::Output;

    where
        A: Display + Debug + Send + Sync + 'static,
        F: FnOnce() -> A
; fn change_context<C>(self, context: C) -> FutureWithContext<Self, C>Notable traits for FutureWithContext<Fut, T>impl<Fut, T> Future for FutureWithContext<Fut, T> where
    Fut: Future,
    Fut::Output: ResultExt,
    T: Context
type Output = Result<<Fut::Output as ResultExt>::Ok, T>;

    where
        C: Context
; fn change_context_lazy<C, F>(
        self,
        context: F
    ) -> FutureWithLazyContext<Self, F>Notable traits for FutureWithLazyContext<Fut, F>impl<Fut, F, T> Future for FutureWithLazyContext<Fut, F> where
    Fut: Future,
    Fut::Output: ResultExt,
    F: FnOnce() -> T,
    T: Context
type Output = Result<<Fut::Output as ResultExt>::Ok, T>;

    where
        C: Context,
        F: FnOnce() -> C
; }
Available on crate feature futures only.
Expand description

Extension trait for Future to provide contextual information on Reports.

Required Methods

Adds a new attachment to the Report inside the Result when polling the Future.

Applies Report::attach on the Err variant, refer to it for more information.

Lazily adds a new attachment to the Report inside the Result when polling the Future.

Applies Report::attach on the Err variant, refer to it for more information.

Adds a new printable attachment to the Report inside the Result when polling the Future.

Applies Report::attach_printable on the Err variant, refer to it for more information.

Lazily adds a new printable attachment to the Report inside the Result when polling the Future.

Applies Report::attach_printable on the Err variant, refer to it for more information.

Changes the Context of the Report inside the Result when polling the Future.

Applies Report::change_context on the Err variant, refer to it for more information.

Lazily changes the Context of the Report inside the Result when polling the Future.

Applies Report::change_context on the Err variant, refer to it for more information.

Implementors