Struct blart::ToBE

source ·
pub struct ToBE<N>(PhantomData<N>);
Expand description

This struct represents a conversion of unsigned integers to the big endian format, so that the natural ordering of the numbers matches the lexicographic ordering of the bytes.

Tuple Fields§

§0: PhantomData<N>

Trait Implementations§

source§

impl BytesMapping for ToBE<NonZeroU128>

§

type Domain = NonZeroU128

The unconverted type that has a specific ordering
§

type Bytes = [u8; 16]

The bytestring type that the Self::Domain is converted to.
source§

fn to_bytes(value: Self::Domain) -> Self::Bytes

Convert the domain type into the bytestring type
source§

fn from_bytes(bytes: Self::Bytes) -> Self::Domain

Convert the bytestring type back into the domain type
source§

impl BytesMapping for ToBE<NonZeroU16>

§

type Domain = NonZeroU16

The unconverted type that has a specific ordering
§

type Bytes = [u8; 2]

The bytestring type that the Self::Domain is converted to.
source§

fn to_bytes(value: Self::Domain) -> Self::Bytes

Convert the domain type into the bytestring type
source§

fn from_bytes(bytes: Self::Bytes) -> Self::Domain

Convert the bytestring type back into the domain type
source§

impl BytesMapping for ToBE<NonZeroU32>

§

type Domain = NonZeroU32

The unconverted type that has a specific ordering
§

type Bytes = [u8; 4]

The bytestring type that the Self::Domain is converted to.
source§

fn to_bytes(value: Self::Domain) -> Self::Bytes

Convert the domain type into the bytestring type
source§

fn from_bytes(bytes: Self::Bytes) -> Self::Domain

Convert the bytestring type back into the domain type
source§

impl BytesMapping for ToBE<NonZeroU64>

§

type Domain = NonZeroU64

The unconverted type that has a specific ordering
§

type Bytes = [u8; 8]

The bytestring type that the Self::Domain is converted to.
source§

fn to_bytes(value: Self::Domain) -> Self::Bytes

Convert the domain type into the bytestring type
source§

fn from_bytes(bytes: Self::Bytes) -> Self::Domain

Convert the bytestring type back into the domain type
source§

impl BytesMapping for ToBE<NonZeroU8>

§

type Domain = NonZeroU8

The unconverted type that has a specific ordering
§

type Bytes = [u8; 1]

The bytestring type that the Self::Domain is converted to.
source§

fn to_bytes(value: Self::Domain) -> Self::Bytes

Convert the domain type into the bytestring type
source§

fn from_bytes(bytes: Self::Bytes) -> Self::Domain

Convert the bytestring type back into the domain type
source§

impl BytesMapping for ToBE<NonZeroUsize>

§

type Domain = NonZeroUsize

The unconverted type that has a specific ordering
§

type Bytes = [u8; 8]

The bytestring type that the Self::Domain is converted to.
source§

fn to_bytes(value: Self::Domain) -> Self::Bytes

Convert the domain type into the bytestring type
source§

fn from_bytes(bytes: Self::Bytes) -> Self::Domain

Convert the bytestring type back into the domain type
source§

impl BytesMapping for ToBE<u128>

§

type Domain = u128

The unconverted type that has a specific ordering
§

type Bytes = [u8; 16]

The bytestring type that the Self::Domain is converted to.
source§

fn to_bytes(value: Self::Domain) -> Self::Bytes

Convert the domain type into the bytestring type
source§

fn from_bytes(bytes: Self::Bytes) -> Self::Domain

Convert the bytestring type back into the domain type
source§

impl BytesMapping for ToBE<u16>

§

type Domain = u16

The unconverted type that has a specific ordering
§

type Bytes = [u8; 2]

The bytestring type that the Self::Domain is converted to.
source§

fn to_bytes(value: Self::Domain) -> Self::Bytes

Convert the domain type into the bytestring type
source§

fn from_bytes(bytes: Self::Bytes) -> Self::Domain

Convert the bytestring type back into the domain type
source§

impl BytesMapping for ToBE<u32>

§

type Domain = u32

The unconverted type that has a specific ordering
§

type Bytes = [u8; 4]

The bytestring type that the Self::Domain is converted to.
source§

fn to_bytes(value: Self::Domain) -> Self::Bytes

Convert the domain type into the bytestring type
source§

fn from_bytes(bytes: Self::Bytes) -> Self::Domain

Convert the bytestring type back into the domain type
source§

impl BytesMapping for ToBE<u64>

§

type Domain = u64

The unconverted type that has a specific ordering
§

type Bytes = [u8; 8]

The bytestring type that the Self::Domain is converted to.
source§

fn to_bytes(value: Self::Domain) -> Self::Bytes

Convert the domain type into the bytestring type
source§

fn from_bytes(bytes: Self::Bytes) -> Self::Domain

Convert the bytestring type back into the domain type
source§

impl BytesMapping for ToBE<u8>

§

type Domain = u8

The unconverted type that has a specific ordering
§

type Bytes = [u8; 1]

The bytestring type that the Self::Domain is converted to.
source§

fn to_bytes(value: Self::Domain) -> Self::Bytes

Convert the domain type into the bytestring type
source§

fn from_bytes(bytes: Self::Bytes) -> Self::Domain

Convert the bytestring type back into the domain type
source§

impl BytesMapping for ToBE<usize>

§

type Domain = usize

The unconverted type that has a specific ordering
§

type Bytes = [u8; 8]

The bytestring type that the Self::Domain is converted to.
source§

fn to_bytes(value: Self::Domain) -> Self::Bytes

Convert the domain type into the bytestring type
source§

fn from_bytes(bytes: Self::Bytes) -> Self::Domain

Convert the bytestring type back into the domain type

Auto Trait Implementations§

§

impl<N> RefUnwindSafe for ToBE<N>where N: RefUnwindSafe,

§

impl<N> Send for ToBE<N>where N: Send,

§

impl<N> Sync for ToBE<N>where N: Sync,

§

impl<N> Unpin for ToBE<N>where N: Unpin,

§

impl<N> UnwindSafe for ToBE<N>where N: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.