async-dropper
is probably the least-worst ad-hoc AsyncDrop
implementation you've seen, and it works in two ways:
async_dropper::simple
is stolen nearly verbatim from this StackOverflow answer (thanks topaholg
!)async_dropper::derive
provides a trait calledAsyncDrop
and corresponding [derive macro][rust-derive-macro], which try to useDefault
andPartialEq
to determine when to async drop.
The code in this crate powers async_dropper::derive
. See the async_dropper
crate for more details.