pub enum Endian {
Little,
Big,
Network,
Native,
}
Variants§
Little
Least Significant Byte first.
Big
Most Significant Byte first.
Network
Conventially used for exchange over a network.
Same as Endian::Big
Native
The endianness of the current processor.
Implementations§
source§impl Endian
impl Endian
sourcepub fn canonical(self) -> Self
pub fn canonical(self) -> Self
Return an Endian::Big
or Endian::Little
accordingly.
sourcepub fn is_big(&self) -> bool
pub fn is_big(&self) -> bool
Returns true if Endian::Big
, Endian::Network
, or if Endian::Native
and on a big-endian processor.
sourcepub fn is_little(&self) -> bool
pub fn is_little(&self) -> bool
Returns true if Endian::Little
, or if Endian::Native
and on a little-endian processor.
Trait Implementations§
source§impl Ord for Endian
impl Ord for Endian
source§impl PartialEq for Endian
impl PartialEq for Endian
source§impl PartialOrd for Endian
impl PartialOrd for Endian
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Endian
impl Eq for Endian
impl StructuralEq for Endian
impl StructuralPartialEq for Endian
Auto Trait Implementations§
impl RefUnwindSafe for Endian
impl Send for Endian
impl Sync for Endian
impl Unpin for Endian
impl UnwindSafe for Endian
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