[][src]Trait packed_struct::PackedStructSlice

pub trait PackedStructSlice where
    Self: Sized
{ fn pack_to_slice(&self, output: &mut [u8]) -> Result<(), PackingError>;
fn unpack_from_slice(src: &[u8]) -> Result<Self, PackingError>;
fn packed_bytes() -> usize; fn pack_to_vec(&self) -> Result<Vec<u8>, PackingError> { ... } }

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

Required methods

fn pack_to_slice(&self, output: &mut [u8]) -> Result<(), PackingError>

Pack the structure into an output buffer.

fn unpack_from_slice(src: &[u8]) -> Result<Self, PackingError>

Unpack the structure from a buffer.

fn packed_bytes() -> usize

Number of bytes that this structure demands for packing or unpacking.

Loading content...

Provided methods

fn pack_to_vec(&self) -> Result<Vec<u8>, PackingError>

Pack the structure into a new byte vector.

Loading content...

Implementations on Foreign Types

impl PackedStructSlice for bool[src]

impl PackedStructSlice for u8[src]

impl PackedStructSlice for i8[src]

Loading content...

Implementors

impl<T, B, I> PackedStructSlice for LsbInteger<T, B, I> where
    B: NumberOfBits + BitsFullBytes,
    I: SizedInteger<T, B>, 
[src]

impl<T, B, I> PackedStructSlice for MsbInteger<T, B, I> where
    B: NumberOfBits,
    I: SizedInteger<T, B>, 
[src]

impl<V, B> PackedStructSlice for ReservedBits<V, B> where
    Self: Default,
    V: ReservedBitValue,
    B: NumberOfBits
[src]

Loading content...