[][src]Trait hex_noalloc::ToHex

pub trait ToHex {
    pub fn encode_hex<T: FromIterator<char>>(&self) -> T;
pub fn encode_hex_upper<T: FromIterator<char>>(&self) -> T; }

Encoding values as hex string.

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

Example

use hex::ToHex;

println!("{}", "Hello world!".encode_hex::<String>());

Note: instead of using this trait, you might want to use encode().

Required methods

pub fn encode_hex<T: FromIterator<char>>(&self) -> T[src]

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

pub fn encode_hex_upper<T: FromIterator<char>>(&self) -> T[src]

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

Loading content...

Implementors

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

Loading content...