Trait endian_trait::Endian [] [src]

pub trait Endian {
    fn to_be(self) -> Self;
fn to_le(self) -> Self;
fn from_be(self) -> Self;
fn from_le(self) -> Self; }

Convert a type from one endian order to another.

The standard implementation of this trait is simply to call the methods on the component members of a data type which are themselves Endian, until the call stack bottoms out at one of Rust's primitives.

Required Methods

Converts from host endian to big-endian order.

On big-endian platforms, this is a no-op and should be compiled out.

Converts from host endian to little-endian order.

On little-endian platforms, this is a no-op and should be compiled out.

Converts from big-endian order to host endian.

On big-endian platforms, this is a no-op and should be compiled out.

Converts form little-endian order to host endian.

On little-endian platforms, this is a no-op and should be compiled out.

Implementors