pub trait Unaligned: Debug + Copy + Eq + Ord + Hash {
    fn byte_swap_unaligned_memory_from_little_endian_to_native_endian(
        unaligned_memory: &mut [Self]
    ) { ... } fn byte_swap_unaligned_memory_from_big_endian_to_native_endian(
        unaligned_memory: &mut [Self]
    ) { ... } fn byte_swap_unaligned_memory(unaligned_memory: &mut [Self]) { ... } fn read_unaligned_byte_swapped(
        aligned: NonNull<Self::Aligned>
    ) -> Self::Aligned { ... } }
Expand description

Byte swap (change endian order of) an array of unaligned memory.

Byte swapping works irrespective of whether a value is signed or unsigned.

Provided Methods

Converts from little endian to native endian.

Does nothing on a little endian CPU architecture.

Converts from big endian to native endian.

Does nothing on a big endian CPU architecture.

Byte swap unaligned memory.

Read an unaligned value and byte swap it before returning it.

May use MOVBE.

Implementors