pub struct BigEndian;
Expand description
Compile-time big endian byte order.
Trait Implementations
sourceimpl Endian for BigEndian
impl Endian for BigEndian
sourcefn 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
sourcefn is_big_endian(self) -> bool
fn is_big_endian(self) -> bool
Return true for big endian byte order.
sourcefn 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
sourcefn is_little_endian(self) -> bool
fn is_little_endian(self) -> bool
Return true for little endian byte order.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
impl Copy for BigEndian
impl Eq for BigEndian
impl StructuralEq for BigEndian
impl StructuralPartialEq for BigEndian
Auto Trait Implementations
impl RefUnwindSafe for BigEndian
impl Send for BigEndian
impl Sync for BigEndian
impl Unpin for BigEndian
impl UnwindSafe for BigEndian
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more