Function std::fmt::write_unsafe
pub unsafe fn write_unsafe(output: &mut Writer, fmt: &[Piece], args: &[Argument]) -> Result
The write_unsafe
function takes an output stream, a precompiled format
string, and a list of arguments. The arguments will be formatted according
to the specified format string into the output stream provided.
See the documentation for format
for why this function is unsafe and care
should be taken if calling it manually.
Thankfully the rust compiler provides macros like write!
and
format_args!
which perform all of this validation at compile-time
and provide a safe interface for invoking this function.
Arguments
- output - the buffer to write output to
- fmts - the precompiled format string to emit
- args - the list of arguments to the format string. These are only the positional arguments (not named)
Note that this function assumes that there are enough arguments for the format string.