AsyncDrop

Trait AsyncDrop 

Source
pub trait AsyncDrop {
    type Dropper: Future<Output = ()> + Send + 'static;

    // Required method
    fn async_drop(self) -> Self::Dropper;
}
Expand description

Trait for types that require async cleanup.

Implement this trait for your type to define how it should be cleaned up asynchronously.

Required Associated Types§

Source

type Dropper: Future<Output = ()> + Send + 'static

The future returned by async_drop.

Required Methods§

Source

fn async_drop(self) -> Self::Dropper

Perform the async cleanup. This method consumes the object.

Implementors§