pub trait IntoOnDrop: Future + Sized {
    // Provided method
    fn on_drop<Fun: FnOnce()>(self, on_drop: Fun) -> OnDrop<Self, Fun>  { ... }
}
Expand description

Futures implementing this trait can attach a closure which will be executed when the future is dropped. See on_drop.

Provided Methods§

source

fn on_drop<Fun: FnOnce()>(self, on_drop: Fun) -> OnDrop<Self, Fun>

Adds on_drop closure to a future. See on_drop.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> IntoOnDrop for T
where T: Future + Sized,