pub trait Endian: Sealed + Copy {
// Required methods
fn to_register_endian<T: PrimInt>(value: T) -> T;
fn from_register_endian<T: PrimInt>(value: T) -> T;
fn address_order_to_significance(
address_order: usize,
num_subwords: usize,
) -> usize;
}Expand description
Endianness of a register
Required Methods§
Sourcefn to_register_endian<T: PrimInt>(value: T) -> T
fn to_register_endian<T: PrimInt>(value: T) -> T
Convert from native endianness to register endianness.
Sourcefn from_register_endian<T: PrimInt>(value: T) -> T
fn from_register_endian<T: PrimInt>(value: T) -> T
Convert from register endianness to native endianness.
Sourcefn address_order_to_significance(
address_order: usize,
num_subwords: usize,
) -> usize
fn address_order_to_significance( address_order: usize, num_subwords: usize, ) -> usize
Given the address order of a subword, return the sigificance order of the subword.
For example, if address_order_to_significance(1, 2) == 0, it indicates
that the subword at the second-to-lowest address (address_order == 1)
is the least significant subword in the register (== 0).
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.