[][src]Trait tree_buf::primitive::EzBytes

pub trait EzBytes {
    type Out: Borrow<[u8]> + TryFrom<&'static [u8]>;
    fn to_bytes(self) -> Self::Out;
fn from_bytes(bytes: Self::Out) -> Self; fn write(self, bytes: &mut Vec<u8>)
    where
        Self: Sized
, { ... }
fn read_bytes(bytes: &[u8], offset: &mut usize) -> Self
    where
        Self: Sized
, { ... } }

Associated Types

Loading content...

Required methods

fn to_bytes(self) -> Self::Out

fn from_bytes(bytes: Self::Out) -> Self

Loading content...

Provided methods

fn write(self, bytes: &mut Vec<u8>) where
    Self: Sized

fn read_bytes(bytes: &[u8], offset: &mut usize) -> Self where
    Self: Sized

Loading content...

Implementations on Foreign Types

impl EzBytes for u32[src]

type Out = [u8; 4]

impl EzBytes for u64[src]

type Out = [u8; 8]

impl EzBytes for usize[src]

type Out = [u8; 8]

impl EzBytes for bool[src]

type Out = [u8; 1]

impl EzBytes for u8[src]

type Out = [u8; 1]

Loading content...

Implementors

Loading content...