Struct BigEndian

Source
pub struct BigEndian<T>(/* private fields */);
Expand description

Big endian byte order.

Most significant byte first.

Implementations§

Source§

impl<T> BigEndian<T>
where T: Sized + Copy,

Source

pub const unsafe fn from_byte_slice(bytes: &[u8]) -> BigEndian<T>

Source

pub fn as_byte_slice(&self) -> &[u8]

Source

pub fn as_byte_slice_mut(&mut self) -> &mut [u8]

Source§

impl BigEndian<u16>

Source

pub const fn to_bytes(self) -> [u8; 2]

Return the memory representation of this type as a byte array in its endian byte order. Note: This is just a transmute.

Source

pub const fn from_bytes(bytes: [u8; 2]) -> BigEndian<u16>

Construct a value from its memory representation as a byte array. Note: This is just a transmute.

Source§

impl BigEndian<u32>

Source

pub const fn to_bytes(self) -> [u8; 4]

Return the memory representation of this type as a byte array in its endian byte order. Note: This is just a transmute.

Source

pub const fn from_bytes(bytes: [u8; 4]) -> BigEndian<u32>

Construct a value from its memory representation as a byte array. Note: This is just a transmute.

Source§

impl BigEndian<u64>

Source

pub const fn to_bytes(self) -> [u8; 8]

Return the memory representation of this type as a byte array in its endian byte order. Note: This is just a transmute.

Source

pub const fn from_bytes(bytes: [u8; 8]) -> BigEndian<u64>

Construct a value from its memory representation as a byte array. Note: This is just a transmute.

Source§

impl BigEndian<u128>

Source

pub const fn to_bytes(self) -> [u8; 16]

Return the memory representation of this type as a byte array in its endian byte order. Note: This is just a transmute.

Source

pub const fn from_bytes(bytes: [u8; 16]) -> BigEndian<u128>

Construct a value from its memory representation as a byte array. Note: This is just a transmute.

Source§

impl BigEndian<usize>

Source

pub const fn to_bytes(self) -> [u8; 8]

Return the memory representation of this type as a byte array in its endian byte order. Note: This is just a transmute.

Source

pub const fn from_bytes(bytes: [u8; 8]) -> BigEndian<usize>

Construct a value from its memory representation as a byte array. Note: This is just a transmute.

Source§

impl BigEndian<i16>

Source

pub const fn to_bytes(self) -> [u8; 2]

Return the memory representation of this type as a byte array in its endian byte order. Note: This is just a transmute.

Source

pub const fn from_bytes(bytes: [u8; 2]) -> BigEndian<i16>

Construct a value from its memory representation as a byte array. Note: This is just a transmute.

Source§

impl BigEndian<i32>

Source

pub const fn to_bytes(self) -> [u8; 4]

Return the memory representation of this type as a byte array in its endian byte order. Note: This is just a transmute.

Source

pub const fn from_bytes(bytes: [u8; 4]) -> BigEndian<i32>

Construct a value from its memory representation as a byte array. Note: This is just a transmute.

Source§

impl BigEndian<i64>

Source

pub const fn to_bytes(self) -> [u8; 8]

Return the memory representation of this type as a byte array in its endian byte order. Note: This is just a transmute.

Source

pub const fn from_bytes(bytes: [u8; 8]) -> BigEndian<i64>

Construct a value from its memory representation as a byte array. Note: This is just a transmute.

Source§

impl BigEndian<i128>

Source

pub const fn to_bytes(self) -> [u8; 16]

Return the memory representation of this type as a byte array in its endian byte order. Note: This is just a transmute.

Source

pub const fn from_bytes(bytes: [u8; 16]) -> BigEndian<i128>

Construct a value from its memory representation as a byte array. Note: This is just a transmute.

Source§

impl BigEndian<isize>

Source

pub const fn to_bytes(self) -> [u8; 8]

Return the memory representation of this type as a byte array in its endian byte order. Note: This is just a transmute.

Source

pub const fn from_bytes(bytes: [u8; 8]) -> BigEndian<isize>

Construct a value from its memory representation as a byte array. Note: This is just a transmute.

Trait Implementations§

Source§

impl<T> BitAnd for BigEndian<T>
where T: BitAnd,

Source§

type Output = BigEndian<<T as BitAnd>::Output>

The resulting type after applying the & operator.
Source§

fn bitand(self, other: Self) -> Self::Output

Performs the & operation. Read more
Source§

impl<T> BitOr for BigEndian<T>
where T: BitOr,

Source§

type Output = BigEndian<<T as BitOr>::Output>

The resulting type after applying the | operator.
Source§

fn bitor(self, other: Self) -> Self::Output

Performs the | operation. Read more
Source§

impl<T> BitXor for BigEndian<T>
where T: BitXor,

Source§

type Output = BigEndian<<T as BitXor>::Output>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, other: Self) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<T: Clone> Clone for BigEndian<T>

Source§

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

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for BigEndian<T>

Source§

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

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

impl From<BigEndian<i128>> for LittleEndian<i128>

Source§

fn from(data: BigEndian<i128>) -> Self

Converts to this type from the input type.
Source§

impl From<BigEndian<i128>> for i128

Source§

fn from(data: BigEndian<i128>) -> i128

Converts to this type from the input type.
Source§

impl From<BigEndian<i16>> for LittleEndian<i16>

Source§

fn from(data: BigEndian<i16>) -> Self

Converts to this type from the input type.
Source§

impl From<BigEndian<i16>> for i16

Source§

fn from(data: BigEndian<i16>) -> i16

Converts to this type from the input type.
Source§

impl From<BigEndian<i32>> for LittleEndian<i32>

Source§

fn from(data: BigEndian<i32>) -> Self

Converts to this type from the input type.
Source§

impl From<BigEndian<i32>> for i32

Source§

fn from(data: BigEndian<i32>) -> i32

Converts to this type from the input type.
Source§

impl From<BigEndian<i64>> for LittleEndian<i64>

Source§

fn from(data: BigEndian<i64>) -> Self

Converts to this type from the input type.
Source§

impl From<BigEndian<i64>> for i64

Source§

fn from(data: BigEndian<i64>) -> i64

Converts to this type from the input type.
Source§

impl From<BigEndian<isize>> for LittleEndian<isize>

Source§

fn from(data: BigEndian<isize>) -> Self

Converts to this type from the input type.
Source§

impl From<BigEndian<isize>> for isize

Source§

fn from(data: BigEndian<isize>) -> isize

Converts to this type from the input type.
Source§

impl From<BigEndian<u128>> for LittleEndian<u128>

Source§

fn from(data: BigEndian<u128>) -> Self

Converts to this type from the input type.
Source§

impl From<BigEndian<u128>> for u128

Source§

fn from(data: BigEndian<u128>) -> u128

Converts to this type from the input type.
Source§

impl From<BigEndian<u16>> for LittleEndian<u16>

Source§

fn from(data: BigEndian<u16>) -> Self

Converts to this type from the input type.
Source§

impl From<BigEndian<u16>> for u16

Source§

fn from(data: BigEndian<u16>) -> u16

Converts to this type from the input type.
Source§

impl From<BigEndian<u32>> for LittleEndian<u32>

Source§

fn from(data: BigEndian<u32>) -> Self

Converts to this type from the input type.
Source§

impl From<BigEndian<u32>> for u32

Source§

fn from(data: BigEndian<u32>) -> u32

Converts to this type from the input type.
Source§

impl From<BigEndian<u64>> for LittleEndian<u64>

Source§

fn from(data: BigEndian<u64>) -> Self

Converts to this type from the input type.
Source§

impl From<BigEndian<u64>> for u64

Source§

fn from(data: BigEndian<u64>) -> u64

Converts to this type from the input type.
Source§

impl From<BigEndian<usize>> for LittleEndian<usize>

Source§

fn from(data: BigEndian<usize>) -> Self

Converts to this type from the input type.
Source§

impl From<BigEndian<usize>> for usize

Source§

fn from(data: BigEndian<usize>) -> usize

Converts to this type from the input type.
Source§

impl From<LittleEndian<i128>> for BigEndian<i128>

Source§

fn from(data: LittleEndian<i128>) -> Self

Converts to this type from the input type.
Source§

impl From<LittleEndian<i16>> for BigEndian<i16>

Source§

fn from(data: LittleEndian<i16>) -> Self

Converts to this type from the input type.
Source§

impl From<LittleEndian<i32>> for BigEndian<i32>

Source§

fn from(data: LittleEndian<i32>) -> Self

Converts to this type from the input type.
Source§

impl From<LittleEndian<i64>> for BigEndian<i64>

Source§

fn from(data: LittleEndian<i64>) -> Self

Converts to this type from the input type.
Source§

impl From<LittleEndian<isize>> for BigEndian<isize>

Source§

fn from(data: LittleEndian<isize>) -> Self

Converts to this type from the input type.
Source§

impl From<LittleEndian<u128>> for BigEndian<u128>

Source§

fn from(data: LittleEndian<u128>) -> Self

Converts to this type from the input type.
Source§

impl From<LittleEndian<u16>> for BigEndian<u16>

Source§

fn from(data: LittleEndian<u16>) -> Self

Converts to this type from the input type.
Source§

impl From<LittleEndian<u32>> for BigEndian<u32>

Source§

fn from(data: LittleEndian<u32>) -> Self

Converts to this type from the input type.
Source§

impl From<LittleEndian<u64>> for BigEndian<u64>

Source§

fn from(data: LittleEndian<u64>) -> Self

Converts to this type from the input type.
Source§

impl From<LittleEndian<usize>> for BigEndian<usize>

Source§

fn from(data: LittleEndian<usize>) -> Self

Converts to this type from the input type.
Source§

impl From<i128> for BigEndian<i128>

Source§

fn from(data: i128) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for BigEndian<i16>

Source§

fn from(data: i16) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for BigEndian<i32>

Source§

fn from(data: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for BigEndian<i64>

Source§

fn from(data: i64) -> Self

Converts to this type from the input type.
Source§

impl From<isize> for BigEndian<isize>

Source§

fn from(data: isize) -> Self

Converts to this type from the input type.
Source§

impl From<u128> for BigEndian<u128>

Source§

fn from(data: u128) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for BigEndian<u16>

Source§

fn from(data: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for BigEndian<u32>

Source§

fn from(data: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u64> for BigEndian<u64>

Source§

fn from(data: u64) -> Self

Converts to this type from the input type.
Source§

impl From<usize> for BigEndian<usize>

Source§

fn from(data: usize) -> Self

Converts to this type from the input type.
Source§

impl<T: Hash> Hash for BigEndian<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<T: Ord> Ord for BigEndian<T>

Source§

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

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

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

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

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

Compares and returns the minimum of two values. Read more
1.50.0 · 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 BigEndian<T>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: PartialOrd> PartialOrd for BigEndian<T>

Source§

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

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · 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 · 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 · 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 · 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: Copy> Copy for BigEndian<T>

Source§

impl<T> Endian<T> for BigEndian<T>

Source§

impl<T: Eq> Eq for BigEndian<T>

Source§

impl<T> StructuralPartialEq for BigEndian<T>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<T> UnwindSafe for BigEndian<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, 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.