macro_rules! with_format_context_mut {
($action:expr) => { ... };
}Expand description
A macro to access the global format context for read-write operations.
This macro provides a convenient way to use and modify the global format context without dealing with mutex locking and unlocking directly.
ยงExample
with_format_context_mut!(|ctx: &mut FormatContext| {
// Use a mutable reference method instead of set_flat which consumes self
let flat_setting = ctx.is_flat();
// Do something with the flat setting
assert!(!flat_setting);
});