#async-drop #async-std #tokio #ad-hoc #async-runtime #async-dropper

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

#1123 in Asynchronous

Download history 12218/week @ 2025-12-28 22516/week @ 2026-01-04 24522/week @ 2026-01-11 20783/week @ 2026-01-18 27126/week @ 2026-01-25 32765/week @ 2026-02-01 27538/week @ 2026-02-08 33848/week @ 2026-02-15 35282/week @ 2026-02-22 49454/week @ 2026-03-01 47009/week @ 2026-03-08 55538/week @ 2026-03-15 44087/week @ 2026-03-22 53256/week @ 2026-03-29 49621/week @ 2026-04-05 35024/week @ 2026-04-12

185,762 downloads per month
Used in 20 crates (3 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.6–6.5MB
~139K SLoC