#tokio #async-drop #async

async-dropper-simple

A simple struct-wrapper (i.e. AsyncDropper<T>) based implementation of AsyncDrop

12 releases

0.2.6 Jan 31, 2024
0.2.5 Oct 20, 2023
0.2.3 Aug 9, 2023
0.1.4 Jul 30, 2023

#713 in Asynchronous

Download history 477/week @ 2024-12-27 859/week @ 2025-01-03 1365/week @ 2025-01-10 1696/week @ 2025-01-17 1761/week @ 2025-01-24 2042/week @ 2025-01-31 1643/week @ 2025-02-07 2627/week @ 2025-02-14 2804/week @ 2025-02-21 3904/week @ 2025-02-28 3609/week @ 2025-03-07 3323/week @ 2025-03-14 2470/week @ 2025-03-21 2435/week @ 2025-03-28 2784/week @ 2025-04-04 3136/week @ 2025-04-11

11,313 downloads per month
Used in 8 crates (2 directly)

MIT license

28KB
552 lines

🗑 async-dropper-simple

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 to paholg!)
  • async_dropper::derive provides a trait called AsyncDrop and corresponding [derive macro][rust-derive-macro], which try to use Default and PartialEq to determine when to async drop.

The code in this crate powers async_dropper::simple. See the async_dropper crate for more details.

Feature flags

Flag Description
tokio Use the [tokio][tokio] async runtime
async-std use the [async-std][async-std] async runtime
no-default-bound Avoid the Default bound on your T by wrapping the interior data in an Option<T>

Dependencies

~0.8–12MB
~150K SLoC