[−][src]Trait packed_struct::PackedStructSlice
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.
Provided methods
fn pack_to_vec(&self) -> Result<Vec<u8>, PackingError>
Pack the structure into a new byte vector.
Implementations on Foreign Types
impl PackedStructSlice for bool
[src]
fn pack_to_slice(&self, output: &mut [u8]) -> Result<(), PackingError>
[src]
fn unpack_from_slice(src: &[u8]) -> Result<Self, PackingError>
[src]
fn packed_bytes() -> usize
[src]
impl PackedStructSlice for u8
[src]
fn pack_to_slice(&self, output: &mut [u8]) -> Result<(), PackingError>
[src]
fn unpack_from_slice(src: &[u8]) -> Result<Self, PackingError>
[src]
fn packed_bytes() -> usize
[src]
impl PackedStructSlice for i8
[src]
fn pack_to_slice(&self, output: &mut [u8]) -> Result<(), PackingError>
[src]
fn unpack_from_slice(src: &[u8]) -> Result<Self, PackingError>
[src]
fn packed_bytes() -> usize
[src]
Implementors
impl<T, B, I> PackedStructSlice for LsbInteger<T, B, I> where
B: NumberOfBits + BitsFullBytes,
I: SizedInteger<T, B>,
[src]
B: NumberOfBits + BitsFullBytes,
I: SizedInteger<T, B>,
fn pack_to_slice(&self, output: &mut [u8]) -> Result<(), PackingError>
[src]
fn unpack_from_slice(src: &[u8]) -> Result<Self, PackingError>
[src]
fn packed_bytes() -> usize
[src]
impl<T, B, I> PackedStructSlice for MsbInteger<T, B, I> where
B: NumberOfBits,
I: SizedInteger<T, B>,
[src]
B: NumberOfBits,
I: SizedInteger<T, B>,
fn pack_to_slice(&self, output: &mut [u8]) -> Result<(), PackingError>
[src]
fn unpack_from_slice(src: &[u8]) -> Result<Self, PackingError>
[src]
fn packed_bytes() -> usize
[src]
impl<V, B> PackedStructSlice for ReservedBits<V, B> where
Self: Default,
V: ReservedBitValue,
B: NumberOfBits,
[src]
Self: Default,
V: ReservedBitValue,
B: NumberOfBits,