devela::num

Trait PrimitiveSplit

Source
pub trait PrimitiveSplit<T, const LEN: usize> {
    // Required methods
    fn into_array_be(self) -> [T; LEN] ;
    fn into_array_le(self) -> [T; LEN] ;
    fn into_array_ne(self) -> [T; LEN] ;
}
Available on crate feature split only.
Expand description

Offers methods to split a primitive into an array of smaller primitives.

See also the Cast type for the equivalent const methods, and the PrimitiveJoin trait for the opposite operations.

Required Methods§

Source

fn into_array_be(self) -> [T; LEN]

Splits self into an array of T in big-endian order.

Source

fn into_array_le(self) -> [T; LEN]

Splits self into an array of T in little-endian order.

Source

fn into_array_ne(self) -> [T; LEN]

Splits self into an array of T in native-endian order.

Implementations on Foreign Types§

Source§

impl PrimitiveSplit<u8, 2> for u16

Source§

fn into_array_be(self) -> [u8; 2]

Source§

fn into_array_le(self) -> [u8; 2]

Source§

fn into_array_ne(self) -> [u8; 2]

Source§

impl PrimitiveSplit<u8, 4> for u32

Source§

fn into_array_be(self) -> [u8; 4]

Source§

fn into_array_le(self) -> [u8; 4]

Source§

fn into_array_ne(self) -> [u8; 4]

Source§

impl PrimitiveSplit<u8, 8> for u64

Source§

fn into_array_be(self) -> [u8; 8]

Source§

fn into_array_le(self) -> [u8; 8]

Source§

fn into_array_ne(self) -> [u8; 8]

Source§

impl PrimitiveSplit<u8, 16> for u128

Source§

fn into_array_be(self) -> [u8; 16]

Source§

fn into_array_le(self) -> [u8; 16]

Source§

fn into_array_ne(self) -> [u8; 16]

Source§

impl PrimitiveSplit<u16, 2> for u32

Source§

fn into_array_be(self) -> [u16; 2]

Source§

fn into_array_le(self) -> [u16; 2]

Source§

fn into_array_ne(self) -> [u16; 2]

Source§

impl PrimitiveSplit<u16, 4> for u64

Source§

fn into_array_be(self) -> [u16; 4]

Source§

fn into_array_le(self) -> [u16; 4]

Source§

fn into_array_ne(self) -> [u16; 4]

Source§

impl PrimitiveSplit<u16, 8> for u128

Source§

fn into_array_be(self) -> [u16; 8]

Source§

fn into_array_le(self) -> [u16; 8]

Source§

fn into_array_ne(self) -> [u16; 8]

Source§

impl PrimitiveSplit<u32, 2> for u64

Source§

fn into_array_be(self) -> [u32; 2]

Source§

fn into_array_le(self) -> [u32; 2]

Source§

fn into_array_ne(self) -> [u32; 2]

Source§

impl PrimitiveSplit<u32, 4> for u128

Source§

fn into_array_be(self) -> [u32; 4]

Source§

fn into_array_le(self) -> [u32; 4]

Source§

fn into_array_ne(self) -> [u32; 4]

Source§

impl PrimitiveSplit<u64, 2> for u128

Source§

fn into_array_be(self) -> [u64; 2]

Source§

fn into_array_le(self) -> [u64; 2]

Source§

fn into_array_ne(self) -> [u64; 2]

Implementors§