[][src]Trait hexutil::unstable::ToHexCore

pub trait ToHexCore {
    type Bytes;
    type Buffer;
    fn create_buffer(len: usize) -> Self::Buffer;
fn buffer_as_bytes(buffer: &mut Self::Buffer) -> &mut [u8];
fn to_binary_bytes(&self) -> Self::Bytes;
fn as_binary_bytes<'a>(&'a self, bytes: &'a Self::Bytes) -> &'a [u8]; }

Convert a type to a binary or hexadecimal representation.

Associated Types

type Bytes

The type of the binary representation.

type Buffer

The buffer for the hexadecimal representation.

Loading content...

Required methods

fn create_buffer(len: usize) -> Self::Buffer

Create a new empty buffer of size len.

fn buffer_as_bytes(buffer: &mut Self::Buffer) -> &mut [u8]

Return a mutable reference to the bytes in the buffer.

fn to_binary_bytes(&self) -> Self::Bytes

Create a bytes type.

fn as_binary_bytes<'a>(&'a self, bytes: &'a Self::Bytes) -> &'a [u8]

Return a reference to the binary representation.

Loading content...

Implementors

Loading content...