rdefer
A Rust crate providing defer functionality for both synchronous and asynchronous code.
Usage
Synchronous Defer
use defer;
let _d = defer!;
println!;
Asynchronous Defer (Feature gated)
This feature is behind the async feature flag.
To use this feature, add rdefer to your Cargo.toml with the async feature enabled:
[]
= { = "*", = ["async"] }
Then you can use it as follows:
use ;
use Arc;
let defer = async_defer!;
exec_before_defer!;
exec_before_defer!;