Trait bee_common::packable::Packable[][src]

pub trait Packable {
    type Error: Debug;
    fn packed_len(&self) -> usize;
fn pack<W: Write>(&self, writer: &mut W) -> Result<(), Self::Error>;
fn unpack_inner<R: Read + ?Sized, const CHECK: bool>(
        reader: &mut R
    ) -> Result<Self, Self::Error>
    where
        Self: Sized
; fn pack_new(&self) -> Vec<u8>
Notable traits for Vec<u8, A>
impl<A> Write for Vec<u8, A> where
    A: Allocator
{ ... }
fn unpack<R: Read + ?Sized>(reader: &mut R) -> Result<Self, Self::Error>
    where
        Self: Sized
, { ... }
fn unpack_unchecked<R: Read + ?Sized>(
        reader: &mut R
    ) -> Result<Self, Self::Error>
    where
        Self: Sized
, { ... } }
Expand description

A trait to pack and unpack types to and from bytes.

Associated Types

Associated error type.

Required methods

Returns the length of the packed bytes.

Packs the instance to bytes and writes them to the passed writer.

Reads bytes from the passed reader and unpacks them into an instance.

Provided methods

Packs the instance to bytes and writes them to a newly allocated vector.

Reads bytes from the passed reader and unpacks them into an instance. Applies syntactic checks.

Reads bytes from the passed reader and unpacks them into an instance. Doesn’t apply syntactic checks.

Implementations on Foreign Types

Implementors