Function domain::utils::base16::display

source ยท
pub fn display<Octets, Target>(octets: &Octets, f: &mut Target) -> Result
where Octets: AsRef<[u8]> + ?Sized, Target: Write,
Expand description

Encodes binary data in Base 16 and writes it into a format stream.

This function is intended to be used in implementations of formatting traits:

use core::fmt;
use domain::utils::base16;

struct Foo<'a>(&'a [u8]);

impl<'a> fmt::Display for Foo<'a> {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        base16::display(&self.0, f)
    }
}