macro_rules! context_guard {
($context:expr_2021, $setter:expr_2021, $clearer:expr_2021) => { ... };
}Expand description
Macro to create a context guard
This macro provides a convenient way to create context guards with setup and cleanup logic.
ยงExample
use foundation_utils::context_guard;
let _guard = context_guard!(
"my_context",
|ctx| println!("set: {}", ctx),
|| println!("cleared")
);