ink_env

Trait FromLittleEndian

pub trait FromLittleEndian {
    type Bytes: Default + AsRef<[u8]> + AsMut<[u8]>;

    // Required method
    fn from_le_bytes(bytes: Self::Bytes) -> Self;
}
Expand description

Allows to instantiate a type from its little-endian bytes representation.

Required Associated Types§

type Bytes: Default + AsRef<[u8]> + AsMut<[u8]>

The little-endian bytes representation.

Required Methods§

fn from_le_bytes(bytes: Self::Bytes) -> Self

Create a new instance from the little-endian bytes representation.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl FromLittleEndian for u8

§

type Bytes = [u8; 1]

§

fn from_le_bytes(bytes: <u8 as FromLittleEndian>::Bytes) -> u8

§

impl FromLittleEndian for u16

§

type Bytes = [u8; 2]

§

fn from_le_bytes(bytes: <u16 as FromLittleEndian>::Bytes) -> u16

§

impl FromLittleEndian for u32

§

type Bytes = [u8; 4]

§

fn from_le_bytes(bytes: <u32 as FromLittleEndian>::Bytes) -> u32

§

impl FromLittleEndian for u64

§

type Bytes = [u8; 8]

§

fn from_le_bytes(bytes: <u64 as FromLittleEndian>::Bytes) -> u64

§

impl FromLittleEndian for u128

§

impl FromLittleEndian for U256

§

type Bytes = [u8; 32]

§

fn from_le_bytes(bytes: <U256 as FromLittleEndian>::Bytes) -> U256

Implementors§