pub enum Endian {
Little,
Big,
}Expand description
The Endian type.
Variants§
Implementations§
Source§impl Endian
impl Endian
Sourcepub fn interpret_u32(self, raw: u32) -> u32
pub fn interpret_u32(self, raw: u32) -> u32
Interpret a u32 whose bytes are in the given endianness as a native u32.
When zerocopy reads a u32 field from a byte slice, the resulting value
has its bytes in file order. On a LE host reading a BE file, the value
needs byte-swapping. This function handles that.
Sourcepub fn interpret_u64(self, raw: u64) -> u64
pub fn interpret_u64(self, raw: u64) -> u64
Performs interpret_u64.
Sourcepub fn interpret_i32(self, raw: i32) -> i32
pub fn interpret_i32(self, raw: i32) -> i32
Performs interpret_i32.
Sourcepub fn interpret_u16(self, raw: u16) -> u16
pub fn interpret_u16(self, raw: u16) -> u16
Performs interpret_u16.
Sourcepub fn encode_u16(self, val: u16) -> u16
pub fn encode_u16(self, val: u16) -> u16
Performs encode_u16.
Sourcepub fn encode_u32(self, val: u32) -> u32
pub fn encode_u32(self, val: u32) -> u32
Performs encode_u32.
Sourcepub fn encode_u64(self, val: u64) -> u64
pub fn encode_u64(self, val: u64) -> u64
Performs encode_u64.
Sourcepub fn encode_i32(self, val: i32) -> i32
pub fn encode_i32(self, val: i32) -> i32
Performs encode_i32.
Trait Implementations§
impl Copy for Endian
impl Eq for Endian
impl StructuralPartialEq for Endian
Auto Trait Implementations§
impl Freeze for Endian
impl RefUnwindSafe for Endian
impl Send for Endian
impl Sync for Endian
impl Unpin for Endian
impl UnsafeUnpin 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