Trait packed_struct::PackedStructSlice[][src]

pub trait PackedStructSlice where
    Self: Sized
{ fn pack_to_slice(&self, output: &mut [u8]) -> PackingResult<()>;
fn unpack_from_slice(src: &[u8]) -> PackingResult<Self>;
fn packed_bytes_size(opt_self: Option<&Self>) -> PackingResult<usize>; fn pack_to_vec(&self) -> PackingResult<Vec<u8>> { ... } }
Expand description

A structure that can be packed and unpacked from a slice of bytes.

Required methods

Pack the structure into an output buffer.

Unpack the structure from a buffer.

Number of bytes that the type or this particular instance of this structure demands for packing or unpacking.

Provided methods

Implementations on Foreign Types

This can only be used as a vector of structures that have a statically known size

Implementors

Slice unpacking for byte arrays