Skip to main content

write_hex

Function write_hex 

Source
pub fn write_hex(f: &mut Formatter<'_>, bytes: &[u8]) -> Result<(), Error>
Expand description

Writes bytes into the formatter as a 0x-prefixed, lowercase hexadecimal string.

Useful for Display implementations that want compact, canonical hex output (e.g. in tracing logs) without allocating an intermediate String. This mirrors the format produced by bytes_to_hex_string, which only accepts fixed-size arrays.