pub struct LittleEndian<T: Endianable>(/* private fields */);Expand description
A wrapper type that ensures the inner Endianable value is treated as Little-Endian.
When creating a LittleEndian instance, the value is converted to little-endian.
When retrieving the inner value with get, it is converted back
to the native endianness.
Implementations§
Source§impl<T: Endianable> LittleEndian<T>
impl<T: Endianable> LittleEndian<T>
Trait Implementations§
Source§impl Byteable for LittleEndian<f32>
impl Byteable for LittleEndian<f32>
Source§fn as_bytearray(self) -> Self::ByteArray
fn as_bytearray(self) -> Self::ByteArray
Converts
self into its ByteableByteArray representation.Source§fn from_bytearray(ba: Self::ByteArray) -> Self
fn from_bytearray(ba: Self::ByteArray) -> Self
Creates an instance of
Self from a ByteableByteArray.Source§fn binary_size() -> usize
fn binary_size() -> usize
Returns the size in bytes of the binary representation of this type.
Source§impl Byteable for LittleEndian<f64>
impl Byteable for LittleEndian<f64>
Source§fn as_bytearray(self) -> Self::ByteArray
fn as_bytearray(self) -> Self::ByteArray
Converts
self into its ByteableByteArray representation.Source§fn from_bytearray(ba: Self::ByteArray) -> Self
fn from_bytearray(ba: Self::ByteArray) -> Self
Creates an instance of
Self from a ByteableByteArray.Source§fn binary_size() -> usize
fn binary_size() -> usize
Returns the size in bytes of the binary representation of this type.
Source§impl Byteable for LittleEndian<i128>
impl Byteable for LittleEndian<i128>
Source§fn as_bytearray(self) -> Self::ByteArray
fn as_bytearray(self) -> Self::ByteArray
Converts
self into its ByteableByteArray representation.Source§fn from_bytearray(ba: Self::ByteArray) -> Self
fn from_bytearray(ba: Self::ByteArray) -> Self
Creates an instance of
Self from a ByteableByteArray.Source§fn binary_size() -> usize
fn binary_size() -> usize
Returns the size in bytes of the binary representation of this type.
Source§impl Byteable for LittleEndian<i16>
impl Byteable for LittleEndian<i16>
Source§fn as_bytearray(self) -> Self::ByteArray
fn as_bytearray(self) -> Self::ByteArray
Converts
self into its ByteableByteArray representation.Source§fn from_bytearray(ba: Self::ByteArray) -> Self
fn from_bytearray(ba: Self::ByteArray) -> Self
Creates an instance of
Self from a ByteableByteArray.Source§fn binary_size() -> usize
fn binary_size() -> usize
Returns the size in bytes of the binary representation of this type.
Source§impl Byteable for LittleEndian<i32>
impl Byteable for LittleEndian<i32>
Source§fn as_bytearray(self) -> Self::ByteArray
fn as_bytearray(self) -> Self::ByteArray
Converts
self into its ByteableByteArray representation.Source§fn from_bytearray(ba: Self::ByteArray) -> Self
fn from_bytearray(ba: Self::ByteArray) -> Self
Creates an instance of
Self from a ByteableByteArray.Source§fn binary_size() -> usize
fn binary_size() -> usize
Returns the size in bytes of the binary representation of this type.
Source§impl Byteable for LittleEndian<i64>
impl Byteable for LittleEndian<i64>
Source§fn as_bytearray(self) -> Self::ByteArray
fn as_bytearray(self) -> Self::ByteArray
Converts
self into its ByteableByteArray representation.Source§fn from_bytearray(ba: Self::ByteArray) -> Self
fn from_bytearray(ba: Self::ByteArray) -> Self
Creates an instance of
Self from a ByteableByteArray.Source§fn binary_size() -> usize
fn binary_size() -> usize
Returns the size in bytes of the binary representation of this type.
Source§impl Byteable for LittleEndian<i8>
impl Byteable for LittleEndian<i8>
Source§fn as_bytearray(self) -> Self::ByteArray
fn as_bytearray(self) -> Self::ByteArray
Converts
self into its ByteableByteArray representation.Source§fn from_bytearray(ba: Self::ByteArray) -> Self
fn from_bytearray(ba: Self::ByteArray) -> Self
Creates an instance of
Self from a ByteableByteArray.Source§fn binary_size() -> usize
fn binary_size() -> usize
Returns the size in bytes of the binary representation of this type.
Source§impl Byteable for LittleEndian<isize>
impl Byteable for LittleEndian<isize>
Source§fn as_bytearray(self) -> Self::ByteArray
fn as_bytearray(self) -> Self::ByteArray
Converts
self into its ByteableByteArray representation.Source§fn from_bytearray(ba: Self::ByteArray) -> Self
fn from_bytearray(ba: Self::ByteArray) -> Self
Creates an instance of
Self from a ByteableByteArray.Source§fn binary_size() -> usize
fn binary_size() -> usize
Returns the size in bytes of the binary representation of this type.
Source§impl Byteable for LittleEndian<u128>
impl Byteable for LittleEndian<u128>
Source§fn as_bytearray(self) -> Self::ByteArray
fn as_bytearray(self) -> Self::ByteArray
Converts
self into its ByteableByteArray representation.Source§fn from_bytearray(ba: Self::ByteArray) -> Self
fn from_bytearray(ba: Self::ByteArray) -> Self
Creates an instance of
Self from a ByteableByteArray.Source§fn binary_size() -> usize
fn binary_size() -> usize
Returns the size in bytes of the binary representation of this type.
Source§impl Byteable for LittleEndian<u16>
impl Byteable for LittleEndian<u16>
Source§fn as_bytearray(self) -> Self::ByteArray
fn as_bytearray(self) -> Self::ByteArray
Converts
self into its ByteableByteArray representation.Source§fn from_bytearray(ba: Self::ByteArray) -> Self
fn from_bytearray(ba: Self::ByteArray) -> Self
Creates an instance of
Self from a ByteableByteArray.Source§fn binary_size() -> usize
fn binary_size() -> usize
Returns the size in bytes of the binary representation of this type.
Source§impl Byteable for LittleEndian<u32>
impl Byteable for LittleEndian<u32>
Source§fn as_bytearray(self) -> Self::ByteArray
fn as_bytearray(self) -> Self::ByteArray
Converts
self into its ByteableByteArray representation.Source§fn from_bytearray(ba: Self::ByteArray) -> Self
fn from_bytearray(ba: Self::ByteArray) -> Self
Creates an instance of
Self from a ByteableByteArray.Source§fn binary_size() -> usize
fn binary_size() -> usize
Returns the size in bytes of the binary representation of this type.
Source§impl Byteable for LittleEndian<u64>
impl Byteable for LittleEndian<u64>
Source§fn as_bytearray(self) -> Self::ByteArray
fn as_bytearray(self) -> Self::ByteArray
Converts
self into its ByteableByteArray representation.Source§fn from_bytearray(ba: Self::ByteArray) -> Self
fn from_bytearray(ba: Self::ByteArray) -> Self
Creates an instance of
Self from a ByteableByteArray.Source§fn binary_size() -> usize
fn binary_size() -> usize
Returns the size in bytes of the binary representation of this type.
Source§impl Byteable for LittleEndian<u8>
impl Byteable for LittleEndian<u8>
Source§fn as_bytearray(self) -> Self::ByteArray
fn as_bytearray(self) -> Self::ByteArray
Converts
self into its ByteableByteArray representation.Source§fn from_bytearray(ba: Self::ByteArray) -> Self
fn from_bytearray(ba: Self::ByteArray) -> Self
Creates an instance of
Self from a ByteableByteArray.Source§fn binary_size() -> usize
fn binary_size() -> usize
Returns the size in bytes of the binary representation of this type.
Source§impl Byteable for LittleEndian<usize>
impl Byteable for LittleEndian<usize>
Source§fn as_bytearray(self) -> Self::ByteArray
fn as_bytearray(self) -> Self::ByteArray
Converts
self into its ByteableByteArray representation.Source§fn from_bytearray(ba: Self::ByteArray) -> Self
fn from_bytearray(ba: Self::ByteArray) -> Self
Creates an instance of
Self from a ByteableByteArray.Source§fn binary_size() -> usize
fn binary_size() -> usize
Returns the size in bytes of the binary representation of this type.
Source§impl<T: Clone + Endianable> Clone for LittleEndian<T>
impl<T: Clone + Endianable> Clone for LittleEndian<T>
Source§fn clone(&self) -> LittleEndian<T>
fn clone(&self) -> LittleEndian<T>
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug + Endianable> Debug for LittleEndian<T>
impl<T: Debug + Endianable> Debug for LittleEndian<T>
Source§impl<T: Endianable + Default> Default for LittleEndian<T>
impl<T: Endianable + Default> Default for LittleEndian<T>
Source§impl<T: Hash + Endianable> Hash for LittleEndian<T>
impl<T: Hash + Endianable> Hash for LittleEndian<T>
Source§impl<T: Ord + Endianable> Ord for LittleEndian<T>
impl<T: Ord + Endianable> Ord for LittleEndian<T>
Source§impl<T: PartialEq + Endianable> PartialEq for LittleEndian<T>
impl<T: PartialEq + Endianable> PartialEq for LittleEndian<T>
Source§impl<T: PartialOrd + Endianable> PartialOrd for LittleEndian<T>
impl<T: PartialOrd + Endianable> PartialOrd for LittleEndian<T>
impl<T: Copy + Endianable> Copy for LittleEndian<T>
impl<T: Eq + Endianable> Eq for LittleEndian<T>
Auto Trait Implementations§
impl<T> Freeze for LittleEndian<T>where
T: Freeze,
impl<T> RefUnwindSafe for LittleEndian<T>where
T: RefUnwindSafe,
impl<T> Send for LittleEndian<T>where
T: Send,
impl<T> Sync for LittleEndian<T>where
T: Sync,
impl<T> Unpin for LittleEndian<T>where
T: Unpin,
impl<T> UnwindSafe for LittleEndian<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<Raw, Regular> ByteableRaw<Regular> for Rawwhere
Regular: ByteableRegular<Raw = Raw>,
Raw: Byteable,
impl<Raw, Regular> ByteableRaw<Regular> for Rawwhere
Regular: ByteableRegular<Raw = Raw>,
Raw: Byteable,
Source§fn to_regular(self) -> Regular
fn to_regular(self) -> Regular
Converts the raw representation to the regular form.
Source§fn from_regular(regular: Regular) -> Raw
fn from_regular(regular: Regular) -> Raw
Converts the regular form to the raw representation.
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)