pub trait Endianity: Debug + Default + Clone + Copy + PartialEq + Eq {
Show 14 methods
// Required method
fn is_big_endian(self) -> bool;
// Provided methods
fn is_little_endian(self) -> bool { ... }
fn read_u16(self, buf: &[u8]) -> u16 { ... }
fn read_u32(self, buf: &[u8]) -> u32 { ... }
fn read_u64(self, buf: &[u8]) -> u64 { ... }
fn read_uint(&mut self, buf: &[u8]) -> u64 { ... }
fn read_i16(self, buf: &[u8]) -> i16 { ... }
fn read_i32(self, buf: &[u8]) -> i32 { ... }
fn read_i64(self, buf: &[u8]) -> i64 { ... }
fn read_f32(self, buf: &[u8]) -> f32 { ... }
fn read_f64(self, buf: &[u8]) -> f64 { ... }
fn write_u16(self, buf: &mut [u8], n: u16) { ... }
fn write_u32(self, buf: &mut [u8], n: u32) { ... }
fn write_u64(self, buf: &mut [u8], n: u64) { ... }
}
Expand description
A trait describing the endianity of some buffer.
Required Methods§
sourcefn is_big_endian(self) -> bool
fn is_big_endian(self) -> bool
Return true for big endian byte order.
Provided Methods§
sourcefn is_little_endian(self) -> bool
fn is_little_endian(self) -> bool
Return true for little endian byte order.