Skip to main content

HexDisplay

Trait HexDisplay 

pub trait HexDisplay {
    // Required methods
    fn to_hex(&self, chunk_size: usize) -> String;
    fn to_hex_from(&self, chunk_size: usize, from: usize) -> String;
}
Available on crate features crypto and std only.
Expand description

Helper trait to show a byte slice as a hex dump

Required Methods§

fn to_hex(&self, chunk_size: usize) -> String

Converts the value of self to a hex dump, returning the owned String.

fn to_hex_from(&self, chunk_size: usize, from: usize) -> String

Converts the value of self to a hex dump beginning at from address, returning the owned String.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

§

impl HexDisplay for [u8]

§

fn to_hex(&self, chunk_size: usize) -> String

§

fn to_hex_from(&self, chunk_size: usize, from: usize) -> String

§

impl HexDisplay for str

§

fn to_hex(&self, chunk_size: usize) -> String

§

fn to_hex_from(&self, chunk_size: usize, from: usize) -> String

Implementors§