pub trait Packable4: Copy + 'static {
type Unpacked: Copy + Default;
// Required methods
fn pack_pair(low: Self, high: Self) -> u8;
fn unpack_pair(packed: u8) -> (Self, Self);
fn unpack_slice_packed(packed: &[u8], unpacked: &mut [Self::Unpacked]);
fn unpack_single(element: Self) -> Self::Unpacked;
}Expand description
Trait for 4-bit types that can be packed two per byte.
Required Associated Types§
Required Methods§
Sourcefn unpack_pair(packed: u8) -> (Self, Self)
fn unpack_pair(packed: u8) -> (Self, Self)
Unpack a single byte into a low and high element.
Sourcefn unpack_slice_packed(packed: &[u8], unpacked: &mut [Self::Unpacked])
fn unpack_slice_packed(packed: &[u8], unpacked: &mut [Self::Unpacked])
Unpack a slice of packed pairs to a slice of unpacked elements.
Sourcefn unpack_single(element: Self) -> Self::Unpacked
fn unpack_single(element: Self) -> Self::Unpacked
Unpack a single element.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".