Skip to main content

NativeEndian

Struct NativeEndian 

Source
pub struct NativeEndian<T>(pub T);
Expand description

A wrapper type for native-endian integer parsing.

Notice that this encoding is not portable across different platforms with different endianness. Thus this wrapper should not be used for data that needs to be shared across different platforms.

Tuple Fields§

§0: T

Trait Implementations§

Source§

impl<T: Clone> Clone for NativeEndian<T>

Source§

fn clone(&self) -> NativeEndian<T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Copy> Copy for NativeEndian<T>

Source§

impl<T: Debug> Debug for NativeEndian<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Default> Default for NativeEndian<T>

Source§

fn default() -> NativeEndian<T>

Returns the “default value” for a type. Read more
Source§

impl<T: Eq> Eq for NativeEndian<T>

Source§

impl FromByteArray for NativeEndian<u8>

Source§

type Size = UInt<UTerm, B1>

Source§

fn from_bytes(array: Array<u8, Self::Size>) -> Self

Source§

impl FromByteArray for NativeEndian<u16>

Source§

type Size = UInt<UInt<UTerm, B1>, B0>

Source§

fn from_bytes(array: Array<u8, Self::Size>) -> Self

Source§

impl FromByteArray for NativeEndian<u32>

Source§

type Size = UInt<UInt<UInt<UTerm, B1>, B0>, B0>

Source§

fn from_bytes(array: Array<u8, Self::Size>) -> Self

Source§

impl FromByteArray for NativeEndian<u64>

Source§

type Size = UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>

Source§

fn from_bytes(array: Array<u8, Self::Size>) -> Self

Source§

impl FromByteArray for NativeEndian<u128>

Source§

type Size = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>

Source§

fn from_bytes(array: Array<u8, Self::Size>) -> Self

Source§

impl FromByteArray for NativeEndian<i8>

Source§

type Size = UInt<UTerm, B1>

Source§

fn from_bytes(array: Array<u8, Self::Size>) -> Self

Source§

impl FromByteArray for NativeEndian<i16>

Source§

type Size = UInt<UInt<UTerm, B1>, B0>

Source§

fn from_bytes(array: Array<u8, Self::Size>) -> Self

Source§

impl FromByteArray for NativeEndian<i32>

Source§

type Size = UInt<UInt<UInt<UTerm, B1>, B0>, B0>

Source§

fn from_bytes(array: Array<u8, Self::Size>) -> Self

Source§

impl FromByteArray for NativeEndian<i64>

Source§

type Size = UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>

Source§

fn from_bytes(array: Array<u8, Self::Size>) -> Self

Source§

impl FromByteArray for NativeEndian<i128>

Source§

type Size = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>

Source§

fn from_bytes(array: Array<u8, Self::Size>) -> Self

Source§

impl FromByteArray for NativeEndian<f32>

Source§

type Size = UInt<UInt<UInt<UTerm, B1>, B0>, B0>

Source§

fn from_bytes(array: Array<u8, Self::Size>) -> Self

Source§

impl FromByteArray for NativeEndian<f64>

Source§

type Size = UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>

Source§

fn from_bytes(array: Array<u8, Self::Size>) -> Self

Source§

impl<T: Hash> Hash for NativeEndian<T>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl IntoByteArray for NativeEndian<u8>

Source§

type Size = UInt<UTerm, B1>

Source§

fn into_bytes(self) -> Array<u8, Self::Size>

Source§

impl IntoByteArray for NativeEndian<u16>

Source§

type Size = UInt<UInt<UTerm, B1>, B0>

Source§

fn into_bytes(self) -> Array<u8, Self::Size>

Source§

impl IntoByteArray for NativeEndian<u32>

Source§

type Size = UInt<UInt<UInt<UTerm, B1>, B0>, B0>

Source§

fn into_bytes(self) -> Array<u8, Self::Size>

Source§

impl IntoByteArray for NativeEndian<u64>

Source§

type Size = UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>

Source§

fn into_bytes(self) -> Array<u8, Self::Size>

Source§

impl IntoByteArray for NativeEndian<u128>

Source§

type Size = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>

Source§

fn into_bytes(self) -> Array<u8, Self::Size>

Source§

impl IntoByteArray for NativeEndian<i8>

Source§

type Size = UInt<UTerm, B1>

Source§

fn into_bytes(self) -> Array<u8, Self::Size>

Source§

impl IntoByteArray for NativeEndian<i16>

Source§

type Size = UInt<UInt<UTerm, B1>, B0>

Source§

fn into_bytes(self) -> Array<u8, Self::Size>

Source§

impl IntoByteArray for NativeEndian<i32>

Source§

type Size = UInt<UInt<UInt<UTerm, B1>, B0>, B0>

Source§

fn into_bytes(self) -> Array<u8, Self::Size>

Source§

impl IntoByteArray for NativeEndian<i64>

Source§

type Size = UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>

Source§

fn into_bytes(self) -> Array<u8, Self::Size>

Source§

impl IntoByteArray for NativeEndian<i128>

Source§

type Size = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>

Source§

fn into_bytes(self) -> Array<u8, Self::Size>

Source§

impl IntoByteArray for NativeEndian<f32>

Source§

type Size = UInt<UInt<UInt<UTerm, B1>, B0>, B0>

Source§

fn into_bytes(self) -> Array<u8, Self::Size>

Source§

impl IntoByteArray for NativeEndian<f64>

Source§

type Size = UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>

Source§

fn into_bytes(self) -> Array<u8, Self::Size>

Source§

impl<T: Ord> Ord for NativeEndian<T>

Source§

fn cmp(&self, other: &NativeEndian<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<T: PartialEq> PartialEq for NativeEndian<T>

Source§

fn eq(&self, other: &NativeEndian<T>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<T: PartialOrd> PartialOrd for NativeEndian<T>

Source§

fn partial_cmp(&self, other: &NativeEndian<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T: PartialEq> StructuralPartialEq for NativeEndian<T>

Auto Trait Implementations§

§

impl<T> Freeze for NativeEndian<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for NativeEndian<T>
where T: RefUnwindSafe,

§

impl<T> Send for NativeEndian<T>
where T: Send,

§

impl<T> Sync for NativeEndian<T>
where T: Sync,

§

impl<T> Unpin for NativeEndian<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for NativeEndian<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for NativeEndian<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.