pub trait Bitfields<const SIZE: usize> {
    const BIT_SIZE: usize;
    const BYTE_SIZE: usize = SIZE;

    fn into_bytes(self) -> [u8; SIZE];
    fn from_bytes(input_byte_buffer: [u8; SIZE]) -> Self;
}

Required Associated Constants

Total amount of Bits the Bitfields within this structure take to contain in a fixed size array.

Provided Associated Constants

Total amount of Bytes the Bitfields within this structure take to contain in a fixed size array.

Required Methods

Inserts the values of the Bitfields in this structure into a fixed size array, consuming the structure.

Returns a fixed sized byte array containing the Bitfields of the provided structure.

Extracts the values of the Bitfields in this structure from a fixed size array while consuming it.

Returns Self with the fields containing the extracted values from provided fixed size array of bytes.

Implementors