Endian

Trait Endian 

Source
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§

Source

fn to_register_endian<T: PrimInt>(value: T) -> T

Convert from native endianness to register endianness.

Source

fn from_register_endian<T: PrimInt>(value: T) -> T

Convert from register endianness to native endianness.

Source

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.

Implementors§