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
fn to_be(self) -> Self
Converts from host endian to big-endian order.
On big-endian platforms, this is a no-op and should be compiled out.
fn to_le(self) -> Self
Converts from host endian to little-endian order.
On little-endian platforms, this is a no-op and should be compiled out.
fn from_be(self) -> Self
Converts from big-endian order to host endian.
On big-endian platforms, this is a no-op and should be compiled out.
fn from_le(self) -> Self
Converts form little-endian order to host endian.
On little-endian platforms, this is a no-op and should be compiled out.