Trait wasm::core::little_endian::LittleEndianBytes

source ·
pub trait LittleEndianBytes<const N: usize> {
    // Required methods
    fn from_le_bytes(bytes: [u8; N]) -> Self;
    fn to_le_bytes(self) -> [u8; N];
}
Expand description

Convert from and to the little endian byte representation of a value

N denotes the number of bytes required for the little endian representation

Required Methods§

source

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

Convert from a byte array to Self

source

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

Convert from self to a byte array

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl LittleEndianBytes<{ ::core::mem::size_of::<$type>() }> for f32

source§

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

source§

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

source§

impl LittleEndianBytes<{ ::core::mem::size_of::<$type>() }> for f64

source§

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

source§

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

source§

impl LittleEndianBytes<{ ::core::mem::size_of::<$type>() }> for i8

source§

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

source§

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

source§

impl LittleEndianBytes<{ ::core::mem::size_of::<$type>() }> for i16

source§

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

source§

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

source§

impl LittleEndianBytes<{ ::core::mem::size_of::<$type>() }> for i32

source§

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

source§

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

source§

impl LittleEndianBytes<{ ::core::mem::size_of::<$type>() }> for i64

source§

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

source§

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

source§

impl LittleEndianBytes<{ ::core::mem::size_of::<$type>() }> for i128

source§

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

source§

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

source§

impl LittleEndianBytes<{ ::core::mem::size_of::<$type>() }> for u8

source§

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

source§

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

source§

impl LittleEndianBytes<{ ::core::mem::size_of::<$type>() }> for u16

source§

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

source§

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

source§

impl LittleEndianBytes<{ ::core::mem::size_of::<$type>() }> for u32

source§

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

source§

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

source§

impl LittleEndianBytes<{ ::core::mem::size_of::<$type>() }> for u64

source§

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

source§

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

source§

impl LittleEndianBytes<{ ::core::mem::size_of::<$type>() }> for u128

source§

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

source§

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

Implementors§