Trait futures_ext::future::FbFutureExt
source · pub trait FbFutureExt: Future {
// Provided methods
fn timeout(self, timeout: Duration) -> Timeout<Self>
where Self: Sized { ... }
fn on_cancel<F: FnOnce()>(self, on_cancel: F) -> OnCancel<Self, F> ⓘ
where Self: Sized { ... }
fn on_cancel_with_data<F>(self, on_cancel: F) -> OnCancelWithData<Self, F> ⓘ
where Self: Sized + CancelData,
F: FnOnce(Self::Data) { ... }
}
Expand description
A trait implemented by default for all Futures which extends the standard functionality.
Provided Methods§
sourcefn timeout(self, timeout: Duration) -> Timeout<Self>where
Self: Sized,
fn timeout(self, timeout: Duration) -> Timeout<Self>where
Self: Sized,
Construct a new tokio::time::Timeout.
sourcefn on_cancel<F: FnOnce()>(self, on_cancel: F) -> OnCancel<Self, F> ⓘwhere
Self: Sized,
fn on_cancel<F: FnOnce()>(self, on_cancel: F) -> OnCancel<Self, F> ⓘwhere
Self: Sized,
Call the on_cancel
callback if this future is canceled (dropped
without completion).
sourcefn on_cancel_with_data<F>(self, on_cancel: F) -> OnCancelWithData<Self, F> ⓘ
fn on_cancel_with_data<F>(self, on_cancel: F) -> OnCancelWithData<Self, F> ⓘ
Call the on_cancel
callback if this future is canceled (dropped
without completion). Pass additional data extracted from the
inner future via the CancelData trait.