[][src]Function domain::utils::base32::display_hex

pub fn display_hex<B: ?Sized, W>(bytes: &B, f: &mut W) -> Result where
    B: AsRef<[u8]>,
    W: Write

Encodes binary data in base32hex 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::base32;
 
struct Foo<'a>(&'a [u8]);

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