Enum object::endian::Endianness
source · pub enum Endianness {
Little,
Big,
}
Expand description
An endianness that is selectable at run-time.
Variants§
Trait Implementations§
source§impl Clone for Endianness
impl Clone for Endianness
source§fn clone(&self) -> Endianness
fn clone(&self) -> Endianness
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Endianness
impl Debug for Endianness
source§impl Default for Endianness
impl Default for Endianness
source§fn default() -> Endianness
fn default() -> Endianness
Returns the “default value” for a type. Read more
source§impl Endian for Endianness
impl Endian for Endianness
source§fn from_big_endian(big_endian: bool) -> Option<Self>
fn from_big_endian(big_endian: bool) -> Option<Self>
Construct a specification for the endianness of some values. Read more
source§fn is_big_endian(self) -> bool
fn is_big_endian(self) -> bool
Return true for big endian byte order.
source§fn from_little_endian(little_endian: bool) -> Option<Self>
fn from_little_endian(little_endian: bool) -> Option<Self>
Construct a specification for the endianness of some values. Read more
source§fn is_little_endian(self) -> bool
fn is_little_endian(self) -> bool
Return true for little endian byte order.
source§fn read_u16_bytes(self, n: [u8; 2]) -> u16
fn read_u16_bytes(self, n: [u8; 2]) -> u16
Converts an unaligned unsigned 16 bit integer to native endian.
source§fn read_u32_bytes(self, n: [u8; 4]) -> u32
fn read_u32_bytes(self, n: [u8; 4]) -> u32
Converts an unaligned unsigned 32 bit integer to native endian.
source§fn read_u64_bytes(self, n: [u8; 8]) -> u64
fn read_u64_bytes(self, n: [u8; 8]) -> u64
Converts an unaligned unsigned 64 bit integer to native endian.
source§fn read_i16_bytes(self, n: [u8; 2]) -> i16
fn read_i16_bytes(self, n: [u8; 2]) -> i16
Converts an unaligned signed 16 bit integer to native endian.
source§fn read_i32_bytes(self, n: [u8; 4]) -> i32
fn read_i32_bytes(self, n: [u8; 4]) -> i32
Converts an unaligned signed 32 bit integer to native endian.
source§fn read_i64_bytes(self, n: [u8; 8]) -> i64
fn read_i64_bytes(self, n: [u8; 8]) -> i64
Converts an unaligned signed 64 bit integer to native endian.
source§fn write_u16_bytes(self, n: u16) -> [u8; 2]
fn write_u16_bytes(self, n: u16) -> [u8; 2]
Converts an unaligned unsigned 16 bit integer from native endian.
source§fn write_u32_bytes(self, n: u32) -> [u8; 4]
fn write_u32_bytes(self, n: u32) -> [u8; 4]
Converts an unaligned unsigned 32 bit integer from native endian.
source§fn write_u64_bytes(self, n: u64) -> [u8; 8]
fn write_u64_bytes(self, n: u64) -> [u8; 8]
Converts an unaligned unsigned 64 bit integer from native endian.
source§fn write_i16_bytes(self, n: i16) -> [u8; 2]
fn write_i16_bytes(self, n: i16) -> [u8; 2]
Converts an unaligned signed 16 bit integer from native endian.
source§impl Hash for Endianness
impl Hash for Endianness
source§impl PartialEq for Endianness
impl PartialEq for Endianness
source§fn eq(&self, other: &Endianness) -> bool
fn eq(&self, other: &Endianness) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for Endianness
impl Eq for Endianness
impl StructuralPartialEq for Endianness
Auto Trait Implementations§
impl Freeze for Endianness
impl RefUnwindSafe for Endianness
impl Send for Endianness
impl Sync for Endianness
impl Unpin for Endianness
impl UnwindSafe for Endianness
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more