pub trait Endianable: Copy {
// Required methods
fn from_le(self) -> Self;
fn from_be(self) -> Self;
fn to_le(self) -> Self;
fn to_be(self) -> Self;
}Expand description
Trait for types that support endianness conversion.
This trait provides methods to convert values to and from little-endian (LE) and big-endian (BE) byte orders. It is implemented for most primitive integer and floating-point types.
Required Methods§
Sourcefn from_le(self) -> Self
fn from_le(self) -> Self
Converts a value from its little-endian representation to the native endianness.
Sourcefn from_be(self) -> Self
fn from_be(self) -> Self
Converts a value from its big-endian representation to the native endianness.
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.