Trait packed_struct::types::SizedInteger [] [src]

pub trait SizedInteger<T, B: NumberOfBits> {
    fn value_bit_mask() -> T;
fn from_primitive(val: T) -> Self;
fn to_primitive(&self) -> T;
fn to_msb_bytes(
        &self
    ) -> <<B as NumberOfBits>::Bytes as NumberOfBytes>::AsBytes;
fn to_lsb_bytes(
        &self
    ) -> <<B as NumberOfBits>::Bytes as NumberOfBytes>::AsBytes
    where
        B: BitsFullBytes
;
fn from_msb_bytes(
        bytes: &<<B as NumberOfBits>::Bytes as NumberOfBytes>::AsBytes
    ) -> Self;
fn from_lsb_bytes(
        bytes: &<<B as NumberOfBits>::Bytes as NumberOfBytes>::AsBytes
    ) -> Self
    where
        B: BitsFullBytes
; }

Convert an integer of a specific bit width into native types.

Required Methods

The bit mask that is used for all incoming values. For an integer of width 8, that is 0xFF.

Convert from the platform native type, applying the value mask.

Convert to the platform's native type.

Convert to a MSB byte representation. 0xAABB is converted into [0xAA, 0xBB].

Convert to a LSB byte representation. 0xAABB is converted into [0xBB, 0xAA].

Convert from a MSB byte array.

Convert from a LSB byte array.

Implementors