Function scolapasta_hex::write_into

source ·
pub fn write_into<T, W>(data: T, dest: W) -> Result<()>
where T: AsRef<[u8]>, W: Write,
Available on crate feature std only.
Expand description

Write hex-encoded octets into the given io::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 = Vec::new();
scolapasta_hex::write_into(data, &mut buf);
assert_eq!(buf, b"4172746963686f6b652052756279".to_vec());

§Errors

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