Skip to main content

fmt_write

Function fmt_write 

Source
pub fn fmt_write(w: &mut impl Write) -> impl FnMut(Argument<'_>) -> c_int + '_
Expand description

Write to a struct that implements fmt::Write.

ยงDifferences

There are a few differences from standard printf format:

  • only valid UTF-8 data can be printed.
  • an X format specifier with a # flag prints the hex data in uppercase, but the leading 0x is still lowercase.
  • an o format specifier with a # flag precedes the number with an o instead of 0.
  • g/G (shorted floating point) is aliased to f/`F`` (decimal floating point).
  • same for a/A (hex floating point).
  • the n format specifier, Specifier::WriteBytesWritten, is not implemented and will cause an error if encountered.
  • precision is ignored for integral types, instead of specifying the minimum number of digits.