async_dropper_simple/lib.rs
1#![cfg_attr(all(doc, CHANNEL_NIGHTLY), feature(doc_cfg))]
2//! The code in this file was shamelessly stolen from
3//! https://stackoverflow.com/questions/71541765/rust-async-drop
4
5#[async_trait::async_trait]
6pub trait AsyncDrop {
7 async fn async_drop(&mut self);
8}
9
10#[cfg(feature = "no-default-bound")]
11mod no_default_bound;
12#[cfg(feature = "no-default-bound")]
13pub use no_default_bound::AsyncDropper;
14
15#[cfg(not(feature = "no-default-bound"))]
16mod default;
17#[cfg(not(feature = "no-default-bound"))]
18pub use default::AsyncDropper;