async-safe-defer
Minimal async- and sync-capable defer
crate with:
- ✅ async support
- ✅ no
unsafe
code - ✅
no_std
+alloc
compatible - ✅ optional
no_alloc
mode - ✅ zero dependencies
Inspired by defer
, but designed for embedded and async contexts.
Usage
Sync
use defer;
Async
use async_scope;
async_scope!.await;
No-alloc
use AsyncScopeNoAlloc;
let mut scope = new;
scope.defer;
scope.run.await;