Trait ToPretty

Source
pub trait ToPretty {
    // Required method
    fn pretty(&self) -> PrettySlice<'_>;

    // Provided method
    fn to_hex(&self) -> String { ... }
}
Expand description

Trait to allow a type to be pretty-printed in format!, where unoverridable defaults cannot otherwise be avoided.

Required Methods§

Source

fn pretty(&self) -> PrettySlice<'_>

Convert a type into a derivative form in order to make format! print it prettily.

Provided Methods§

Source

fn to_hex(&self) -> String

Express the object as a hex string.

Implementors§

Source§

impl<T: AsRef<[u8]>> ToPretty for T