Here's what I'm imagining: ```rust enum Item { InternedString(usize), String(&str), Char(char), Primitive(usize, &[u8], FormattingOptions), } struct DeferredWriter(&mut Stream); impl Write for DeferredWriter { fn write_str(&mut self, s: &str) -> core::fmt::Result { match s.interned() { Some(id) => self.0.write(Item::InternedString(id)), None => self.0.write(Item::String(s)), } } fn write_char(&mut self, c: char) -> core::fmt::Result { self.0.write(Item::Char(c)) } fn write_primitive(&mut self, name: &'static str, bytes: &[u8], options: FormattingOptions) -> core::fmt::Result { self.0.write(Item::Primitive(name.interned().unwrap(), bytes, options)) } // Normally this function isn't implemented by a user fn write_fmt(&mut self, args: Arguments<'_>) -> core::fmt::Result { // A call that does the normal `write_fmt` things, except with a 'deferred' formatter flag active args.format_with_primitives(self) } } fn main() { let username = // read from stdin. Input = "Dion" let current_hour = // read time. Value = 11u32 let mut stream = // ... (Normally some sort of connection to a server or host machine) writeln!(DeferredWriter(&mut stream), "Hello {username}! It's currently {current_hour:#X}h").unwrap(); assert_eq!( stream.trace, [ Item::InternedString(123), // Points to debug info containing "Hello " Item::String("Dion"), Item::InternedString(564), // Points to debug info containing "! It's currently " Item::Primitive( 964, // Points to debug info containing "u32" &[11, 0, 0, 0], FormattingOptions { pretty: true, upper_hex: true, ..Default::default() } // This is not public API yet (gated behind feature flag) ), Item::InternedString(647), // Points to debug info containing "h\n" ] ); } ```