pub enum ByteOrder {
BE,
LE,
}
Expand description
An enumeration used in the creation of NumberReader
and NumberWriter
structures to specify what endianness their operations should be performed
with.
§Examples
Constructing a NumberWriter
which writes numbers with big-endian byte
order:
use byte_order::{ByteOrder, NumberWriter};
let be_writer = NumberWriter::with_order(ByteOrder::BE, vec![]);
Likewise, constructing another NumberWriter
which now writes numbers
with little-endian byte order:
let le_writer = NumberWriter::with_order(ByteOrder::LE, vec![]);
Variants§
Implementations§
Source§impl ByteOrder
impl ByteOrder
Sourcepub const NE: ByteOrder
pub const NE: ByteOrder
The native-endian serialization of the target platform. This value will
be equal to ByteOrder::BE
or ByteOrder::LE
.
§Examples
use byte_order::ByteOrder;
assert_eq!(
ByteOrder::NE,
if cfg!(target_endian = "big") { ByteOrder::BE } else { ByteOrder::LE }
);
Trait Implementations§
impl Eq for ByteOrder
impl StructuralPartialEq for ByteOrder
Auto Trait Implementations§
impl Freeze for ByteOrder
impl RefUnwindSafe for ByteOrder
impl Send for ByteOrder
impl Sync for ByteOrder
impl Unpin for ByteOrder
impl UnwindSafe for ByteOrder
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