macro_rules! iwrite { ($buf: expr, $fmt:expr, $($context:tt)*) => { ... }; }
write() as a macro to allow specifying the context directly.
write()
For details on the context syntax see context!.
context!
use std::fmt::Write; use interpolator::iwrite; let mut buf = String::new(); iwrite!(&mut buf, "{a}, {b:?}", a = 10, b:? = "test").unwrap(); assert_eq!( buf, "10, \"test\"" );