Trait packed_struct::PackedStruct[][src]

pub trait PackedStruct<B> where
    Self: Sized
{ fn pack(&self) -> B;
fn unpack(src: &B) -> Result<Self, PackingError>; }

A structure that can be packed and unpacked from a byte array.

In case the structure occupies less bits than there are in the byte array, the packed that should be aligned to the end of the array, with leading bits being ignored.

10 bits packs into: [0b00000011, 0b11111111]

Required Methods

Packs the structure into a byte array.

Unpacks the structure from a byte array.

Implementations on Foreign Types

impl PackedStruct<[u8; 1]> for [u8; 1]
[src]

impl PackedStruct<[u8; 2]> for [u8; 2]
[src]

impl PackedStruct<[u8; 3]> for [u8; 3]
[src]

impl PackedStruct<[u8; 4]> for [u8; 4]
[src]

impl PackedStruct<[u8; 5]> for [u8; 5]
[src]

impl PackedStruct<[u8; 6]> for [u8; 6]
[src]

impl PackedStruct<[u8; 7]> for [u8; 7]
[src]

impl PackedStruct<[u8; 8]> for [u8; 8]
[src]

impl PackedStruct<[u8; 9]> for [u8; 9]
[src]

impl PackedStruct<[u8; 10]> for [u8; 10]
[src]

impl PackedStruct<[u8; 11]> for [u8; 11]
[src]

impl PackedStruct<[u8; 12]> for [u8; 12]
[src]

impl PackedStruct<[u8; 13]> for [u8; 13]
[src]

impl PackedStruct<[u8; 14]> for [u8; 14]
[src]

impl PackedStruct<[u8; 15]> for [u8; 15]
[src]

impl PackedStruct<[u8; 16]> for [u8; 16]
[src]

impl PackedStruct<[u8; 17]> for [u8; 17]
[src]

impl PackedStruct<[u8; 18]> for [u8; 18]
[src]

impl PackedStruct<[u8; 19]> for [u8; 19]
[src]

impl PackedStruct<[u8; 20]> for [u8; 20]
[src]

impl PackedStruct<[u8; 21]> for [u8; 21]
[src]

impl PackedStruct<[u8; 22]> for [u8; 22]
[src]

impl PackedStruct<[u8; 23]> for [u8; 23]
[src]

impl PackedStruct<[u8; 24]> for [u8; 24]
[src]

impl PackedStruct<[u8; 25]> for [u8; 25]
[src]

impl PackedStruct<[u8; 26]> for [u8; 26]
[src]

impl PackedStruct<[u8; 27]> for [u8; 27]
[src]

impl PackedStruct<[u8; 28]> for [u8; 28]
[src]

impl PackedStruct<[u8; 29]> for [u8; 29]
[src]

impl PackedStruct<[u8; 30]> for [u8; 30]
[src]

impl PackedStruct<[u8; 31]> for [u8; 31]
[src]

impl PackedStruct<[u8; 32]> for [u8; 32]
[src]

impl PackedStruct<[u8; 1]> for bool
[src]

impl PackedStruct<[u8; 1]> for u8
[src]

impl PackedStruct<[u8; 1]> for i8
[src]

impl PackedStruct<[u8; 0]> for ()
[src]

Implementors