pub trait ArrayEncoding: Encoding {
type ByteSize: ArraySize + 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>;
// Provided methods
fn from_byte_array(bytes: ByteArray<Self>, byte_order: ByteOrder) -> Self { ... }
fn to_byte_array(&self, byte_order: ByteOrder) -> ByteArray<Self> { ... }
}Expand description
Support for encoding a big integer as a Array.
Required Associated Types§
Required Methods§
Sourcefn from_be_byte_array(bytes: ByteArray<Self>) -> Self
fn from_be_byte_array(bytes: ByteArray<Self>) -> Self
Deserialize from a big-endian byte array.
Sourcefn from_le_byte_array(bytes: ByteArray<Self>) -> Self
fn from_le_byte_array(bytes: ByteArray<Self>) -> Self
Deserialize from a little-endian byte array.
Sourcefn to_be_byte_array(&self) -> ByteArray<Self>
fn to_be_byte_array(&self) -> ByteArray<Self>
Serialize to a big-endian byte array.
Sourcefn to_le_byte_array(&self) -> ByteArray<Self>
fn to_le_byte_array(&self) -> ByteArray<Self>
Serialize to a little-endian byte array.
Provided Methods§
Sourcefn from_byte_array(bytes: ByteArray<Self>, byte_order: ByteOrder) -> Self
fn from_byte_array(bytes: ByteArray<Self>, byte_order: ByteOrder) -> Self
Deserialize from a byte array with the specified ByteOrder.
Sourcefn to_byte_array(&self, byte_order: ByteOrder) -> ByteArray<Self>
fn to_byte_array(&self, byte_order: ByteOrder) -> ByteArray<Self>
Serialize to a byte array with the specified ByteOrder.
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.