wiwi::num

Trait ArrayConversions

Source
pub trait ArrayConversions<const N: usize>
where Self: Sealed,
{ // Required methods fn into_le_bytes(self) -> [u8; N]; fn into_be_bytes(self) -> [u8; N]; fn into_ne_bytes(self) -> [u8; N]; fn from_le_bytes(bytes: [u8; N]) -> Self; fn from_be_bytes(bytes: [u8; N]) -> Self; fn from_ne_bytes(bytes: [u8; N]) -> Self; }

Required Methods§

Source

fn into_le_bytes(self) -> [u8; N]

Source

fn into_be_bytes(self) -> [u8; N]

Source

fn into_ne_bytes(self) -> [u8; N]

Source

fn from_le_bytes(bytes: [u8; N]) -> Self

Source

fn from_be_bytes(bytes: [u8; N]) -> Self

Source

fn from_ne_bytes(bytes: [u8; N]) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ArrayConversions<1> for i8

Source§

fn into_le_bytes(self) -> [u8; 1]

Source§

fn into_be_bytes(self) -> [u8; 1]

Source§

fn into_ne_bytes(self) -> [u8; 1]

Source§

fn from_le_bytes(bytes: [u8; 1]) -> i8

Source§

fn from_be_bytes(bytes: [u8; 1]) -> i8

Source§

fn from_ne_bytes(bytes: [u8; 1]) -> i8

Source§

impl ArrayConversions<1> for u8

Source§

fn into_le_bytes(self) -> [u8; 1]

Source§

fn into_be_bytes(self) -> [u8; 1]

Source§

fn into_ne_bytes(self) -> [u8; 1]

Source§

fn from_le_bytes(bytes: [u8; 1]) -> u8

Source§

fn from_be_bytes(bytes: [u8; 1]) -> u8

Source§

fn from_ne_bytes(bytes: [u8; 1]) -> u8

Source§

impl ArrayConversions<2> for i16

Source§

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

Source§

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

Source§

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

Source§

fn from_le_bytes(bytes: [u8; 2]) -> i16

Source§

fn from_be_bytes(bytes: [u8; 2]) -> i16

Source§

fn from_ne_bytes(bytes: [u8; 2]) -> i16

Source§

impl ArrayConversions<2> for u16

Source§

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

Source§

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

Source§

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

Source§

fn from_le_bytes(bytes: [u8; 2]) -> u16

Source§

fn from_be_bytes(bytes: [u8; 2]) -> u16

Source§

fn from_ne_bytes(bytes: [u8; 2]) -> u16

Source§

impl ArrayConversions<4> for f32

Source§

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

Source§

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

Source§

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

Source§

fn from_le_bytes(bytes: [u8; 4]) -> f32

Source§

fn from_be_bytes(bytes: [u8; 4]) -> f32

Source§

fn from_ne_bytes(bytes: [u8; 4]) -> f32

Source§

impl ArrayConversions<4> for i32

Source§

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

Source§

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

Source§

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

Source§

fn from_le_bytes(bytes: [u8; 4]) -> i32

Source§

fn from_be_bytes(bytes: [u8; 4]) -> i32

Source§

fn from_ne_bytes(bytes: [u8; 4]) -> i32

Source§

impl ArrayConversions<4> for u32

Source§

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

Source§

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

Source§

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

Source§

fn from_le_bytes(bytes: [u8; 4]) -> u32

Source§

fn from_be_bytes(bytes: [u8; 4]) -> u32

Source§

fn from_ne_bytes(bytes: [u8; 4]) -> u32

Source§

impl ArrayConversions<8> for f64

Source§

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

Source§

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

Source§

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

Source§

fn from_le_bytes(bytes: [u8; 8]) -> f64

Source§

fn from_be_bytes(bytes: [u8; 8]) -> f64

Source§

fn from_ne_bytes(bytes: [u8; 8]) -> f64

Source§

impl ArrayConversions<8> for i64

Source§

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

Source§

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

Source§

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

Source§

fn from_le_bytes(bytes: [u8; 8]) -> i64

Source§

fn from_be_bytes(bytes: [u8; 8]) -> i64

Source§

fn from_ne_bytes(bytes: [u8; 8]) -> i64

Source§

impl ArrayConversions<8> for isize

Source§

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

Source§

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

Source§

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

Source§

fn from_le_bytes(bytes: [u8; 8]) -> isize

Source§

fn from_be_bytes(bytes: [u8; 8]) -> isize

Source§

fn from_ne_bytes(bytes: [u8; 8]) -> isize

Source§

impl ArrayConversions<8> for u64

Source§

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

Source§

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

Source§

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

Source§

fn from_le_bytes(bytes: [u8; 8]) -> u64

Source§

fn from_be_bytes(bytes: [u8; 8]) -> u64

Source§

fn from_ne_bytes(bytes: [u8; 8]) -> u64

Source§

impl ArrayConversions<8> for usize

Source§

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

Source§

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

Source§

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

Source§

fn from_le_bytes(bytes: [u8; 8]) -> usize

Source§

fn from_be_bytes(bytes: [u8; 8]) -> usize

Source§

fn from_ne_bytes(bytes: [u8; 8]) -> usize

Source§

impl ArrayConversions<16> for i128

Source§

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

Source§

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

Source§

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

Source§

fn from_le_bytes(bytes: [u8; 16]) -> i128

Source§

fn from_be_bytes(bytes: [u8; 16]) -> i128

Source§

fn from_ne_bytes(bytes: [u8; 16]) -> i128

Source§

impl ArrayConversions<16> for u128

Source§

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

Source§

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

Source§

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

Source§

fn from_le_bytes(bytes: [u8; 16]) -> u128

Source§

fn from_be_bytes(bytes: [u8; 16]) -> u128

Source§

fn from_ne_bytes(bytes: [u8; 16]) -> u128

Implementors§