display

Function display 

Source
pub fn display<T: AsRef<[u8]>>(input: T) -> impl Display + LowerHex + UpperHex
Expand description

Returns a value that can be formatted using the fmt traits.

Supports fmt::LowerHex, fmt::UpperHex, and fmt::Display (which is the same as fmt::LowerHex), as well as using the alternate flag (:#) to write the hex prefix.

ยงExamples

let bytes: &[u8] = &[0xde, 0xad, 0xbe, 0xef];
let displayed = const_hex::display(bytes);
let s = format!("{displayed} {displayed:#X}");
assert_eq!(s, "deadbeef 0xDEADBEEF");