Crate async_safe_defer

Source
Expand description

This library provides two implementations of RAII-style deferred execution: one using dynamic allocation (the default) and one that avoids allocation entirely (no_alloc), with a fixed-capacity array of deferred function pointers.

Modules§

no_allocno_alloc
A module for a no-alloc, fixed-capacity async scope.

Macros§

async_scope
Macro that creates an async scope to automatically await all defers.
defer
Macro for creating a synchronous defer guard.
no_alloc_async_scopeno_alloc
Macro to create a no-alloc async scope with fixed capacity.

Structs§

AsyncScope
An async-aware scope guard that stores deferred async closures (heap-based).

Functions§

defer
RAII-style guard for executing a closure at the end of a scope.