Trait ink_env::FromLittleEndian

source ·
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§

source

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

The little-endian bytes representation.

Required Methods§

source

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§

source§

impl FromLittleEndian for u8

§

type Bytes = [u8; 1]

source§

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

source§

impl FromLittleEndian for u16

§

type Bytes = [u8; 2]

source§

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

source§

impl FromLittleEndian for u32

§

type Bytes = [u8; 4]

source§

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

source§

impl FromLittleEndian for u64

§

type Bytes = [u8; 8]

source§

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

source§

impl FromLittleEndian for u128

§

type Bytes = [u8; 16]

source§

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

Implementors§