pub trait ArrayEncoding: Encoding {
    type ByteSize: ArrayLength<u8> + Add + Eq + Ord + Unsigned;

    // Required methods
    fn from_be_byte_array(bytes: ByteArray<Self>) -> Self;
    fn from_le_byte_array(bytes: ByteArray<Self>) -> Self;
    fn to_be_byte_array(&self) -> ByteArray<Self>;
    fn to_le_byte_array(&self) -> ByteArray<Self>;
}
Expand description

Support for encoding a big integer as a GenericArray.

Required Associated Types§

source

type ByteSize: ArrayLength<u8> + Add + Eq + Ord + Unsigned

Size of a byte array which encodes a big integer.

Required Methods§

source

fn from_be_byte_array(bytes: ByteArray<Self>) -> Self

Deserialize from a big-endian byte array.

source

fn from_le_byte_array(bytes: ByteArray<Self>) -> Self

Deserialize from a little-endian byte array.

source

fn to_be_byte_array(&self) -> ByteArray<Self>

Serialize to a big-endian byte array.

source

fn to_le_byte_array(&self) -> ByteArray<Self>

Serialize to a little-endian byte array.

Implementors§

source§

impl ArrayEncoding for U64

source§

impl ArrayEncoding for U128

source§

impl ArrayEncoding for U192

source§

impl ArrayEncoding for U256

source§

impl ArrayEncoding for U384

source§

impl ArrayEncoding for U448

source§

impl ArrayEncoding for U512

source§

impl ArrayEncoding for U576

source§

impl ArrayEncoding for U768

source§

impl ArrayEncoding for U896

source§

impl ArrayEncoding for U1024

source§

impl ArrayEncoding for U1536

source§

impl ArrayEncoding for U1792

source§

impl ArrayEncoding for U2048

source§

impl ArrayEncoding for U3072

source§

impl ArrayEncoding for U3584

source§

impl ArrayEncoding for U4096

source§

impl ArrayEncoding for U6144

source§

impl ArrayEncoding for U8192