Behind the Scenes of Rust String Formatting: format_args!()
The fmt::Arguments
type is one of my favorite types in the Rust standard library.
It’s not particularly amazing, but it is a great building block that is indirectly used in nearly every Rust program.
This type, together with the format_args!()
macro,
is the power behind print!()
, format!()
, log::info!()
and many more text formatting macros,
both from the standard library and community crates.
In this blog post, we learn how it works, how it is implemented today, and how that might change in the future.