Struct extfmt::Hexlify [] [src]

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

Formats a byte-buffer as a series of concatanated hex-pairs.

Implements the following formatting traits: - Display, Debug, LowerHex - Will format in all letters in lowercase. - UpperHex - Will format in all letters in uppercase

Examples

use extfmt::*;

assert_eq!(format!("{}", Hexlify(&[122, 123, 134])), "7a7b86");
assert_eq!(format!("{:X}", Hexlify(&[122, 123, 134])), "7A7B86");
assert_eq!(format!("{:X}", Hexlify(&[122, 123, 134])), "7A7B86");

Trait Implementations

impl<'a> LowerHex for Hexlify<'a>
[src]

[src]

Formats the value using the given formatter.

impl<'a> UpperHex for Hexlify<'a>
[src]

[src]

Formats the value using the given formatter.

impl<'a> Debug for Hexlify<'a>
[src]

[src]

Formats the value using the given formatter.

impl<'a> Display for Hexlify<'a>
[src]

[src]

Formats the value using the given formatter. Read more