Function scolapasta_hex::format_into

source ·
pub fn format_into<T, W>(data: T, f: W) -> Result
where T: AsRef<[u8]>, W: Write,
Expand description

Write hex-encoded octets into the given fmt::Write.

This function writes UTF-8 encoded octets into the given writer. This function does not allocate, but the given writer may.

§Examples

let data = b"Artichoke Ruby";
let mut buf = String::new();
scolapasta_hex::format_into(data, &mut buf);
assert_eq!(buf, "4172746963686f6b652052756279");

§Errors

If the formatter returns an error, that error is returned.