pub trait Endianess {
// Required methods
fn into_host_u16(&self, n: u16) -> u16;
fn into_host_u32(&self, n: u32) -> u32;
fn into_host_u64(&self, n: u64) -> u64;
fn from_host_u16(&self, n: u16) -> u16;
fn from_host_u32(&self, n: u32) -> u32;
fn from_host_u64(&self, n: u64) -> u64;
}
Expand description
A trait for endianness conversion.
Required Methods§
Sourcefn into_host_u16(&self, n: u16) -> u16
fn into_host_u16(&self, n: u16) -> u16
Converts a device-endian u16
to host-endian u16
.
Sourcefn into_host_u32(&self, n: u32) -> u32
fn into_host_u32(&self, n: u32) -> u32
Converts a device-endian u32
to host-endian u32
.
Sourcefn into_host_u64(&self, n: u64) -> u64
fn into_host_u64(&self, n: u64) -> u64
Converts a device-endian u64
to host-endian u64
.
Sourcefn from_host_u16(&self, n: u16) -> u16
fn from_host_u16(&self, n: u16) -> u16
Converts a host-endian u16
to device-endian u16
.
Sourcefn from_host_u32(&self, n: u32) -> u32
fn from_host_u32(&self, n: u32) -> u32
Converts a host-endian u32
to device-endian u32
.
Sourcefn from_host_u64(&self, n: u64) -> u64
fn from_host_u64(&self, n: u64) -> u64
Converts a host-endian u64
to device-endian u64
.