Trait ToHex

Source
pub trait ToHex {
    // Required method
    fn encode_hex<T: FromIterator<char>>(&self) -> T;
}
👎Deprecated: use ToHexExt instead
Expand description

Encoding values as hex string.

This trait is implemented for all T which implement AsRef<[u8]>. This includes String, str, Vec<u8> and [u8].

§Examples

#![allow(deprecated)]
use lowercase_hex::ToHex;

assert_eq!("Hello world!".encode_hex::<String>(), "48656c6c6f20776f726c6421");

Required Methods§

Source

fn encode_hex<T: FromIterator<char>>(&self) -> T

👎Deprecated: use ToHexExt instead

Encode the hex strict representing self into the result. Lower case letters are used (e.g. f9b4ca).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

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