Struct TypedInteger

Source
pub struct TypedInteger<H0: Hex, H1: Hex, H2: Hex, H3: Hex, H4: Hex, H5: Hex, H6: Hex, H7: Hex> {
    pub _m0: PhantomData<H0>,
    pub _m1: PhantomData<H1>,
    pub _m2: PhantomData<H2>,
    pub _m3: PhantomData<H3>,
    pub _m4: PhantomData<H4>,
    pub _m5: PhantomData<H5>,
    pub _m6: PhantomData<H6>,
    pub _m7: PhantomData<H7>,
}
Expand description

A struct which generics represents an unique integer from 0 to 2 ** 32 - 1

Example

use const_arithmetic::*;
let a = parse_integer!(3);
// a has type TypedInteger<_3, _0, _0, _0, _0, _0, _0, _0>

Fields§

§_m0: PhantomData<H0>§_m1: PhantomData<H1>§_m2: PhantomData<H2>§_m3: PhantomData<H3>§_m4: PhantomData<H4>§_m5: PhantomData<H5>§_m6: PhantomData<H6>§_m7: PhantomData<H7>

Implementations§

Source§

impl<H0: Hex, H1: Hex, H2: Hex, H3: Hex, H4: Hex, H5: Hex, H6: Hex, H7: Hex> TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>

Source

pub const fn number() -> u32

Returns the value of the Typed integer

Example

use const_arithmetic::*;
let a = parse_integer!(3);
assert_eq!(a.number(), 3);

Trait Implementations§

Source§

impl<H0: Clone + Hex, H1: Clone + Hex, H2: Clone + Hex, H3: Clone + Hex, H4: Clone + Hex, H5: Clone + Hex, H6: Clone + Hex, H7: Clone + Hex> Clone for TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>

Source§

fn clone(&self) -> TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>

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<H0: Hex, H1: Hex, H2: Hex, H3: Hex, H4: Hex, H5: Hex, H6: Hex, H7: Hex> IsInteger for TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>

Source§

type Hex0 = H0

Source§

type Hex1 = H1

Source§

type Hex2 = H2

Source§

type Hex3 = H3

Source§

type Hex4 = H4

Source§

type Hex5 = H5

Source§

type Hex6 = H6

Source§

type Hex7 = H7

Source§

fn number() -> u32

Source§

impl<N: IsInteger, H0: Hex, H1: Hex, H2: Hex, H3: Hex, H4: Hex, H5: Hex, H6: Hex, H7: Hex, R: IsInteger> TypedAdd<N> for TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>
where TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>: _Add<N, Output = R>,

Source§

impl<N: IsInteger, H0: Hex, H1: Hex, H2: Hex, H3: Hex, H4: Hex, H5: Hex, H6: Hex, H7: Hex, R: IsInteger, O: IsInteger> TypedDiv<N> for TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>
where TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>: _Div<N, Output = R, Remainder = O>,

Source§

impl<N, H0: Hex, H1: Hex, H2: Hex, H3: Hex, H4: Hex, H5: Hex, H6: Hex, H7: Hex, R: Binary> TypedEqual<N> for TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>
where N: _Equal<TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>, Output = R> + IsInteger,

Source§

impl<N: IsInteger, H0: Hex, H1: Hex, H2: Hex, H3: Hex, H4: Hex, H5: Hex, H6: Hex, H7: Hex, R: Binary> TypedGeq<N> for TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>
where TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>: _Geq<N, Output = R>,

Source§

impl<N: IsInteger, H0: Hex, H1: Hex, H2: Hex, H3: Hex, H4: Hex, H5: Hex, H6: Hex, H7: Hex, R: Binary> TypedGreaterThan<N> for TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>
where TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>: _GreaterThan<N, Output = R>,

Source§

impl<N: IsInteger, H0: Hex, H1: Hex, H2: Hex, H3: Hex, H4: Hex, H5: Hex, H6: Hex, H7: Hex, R: Binary> TypedLeq<N> for TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>
where TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>: _Leq<N, Output = R>,

Source§

impl<N: IsInteger, H0: Hex, H1: Hex, H2: Hex, H3: Hex, H4: Hex, H5: Hex, H6: Hex, H7: Hex, R: Binary> TypedLessThan<N> for TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>
where TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>: _LessThan<N, Output = R>,

Source§

impl<N: IsInteger, H0: Hex, H1: Hex, H2: Hex, H3: Hex, H4: Hex, H5: Hex, H6: Hex, H7: Hex, R: IsInteger, O: IsInteger> TypedMul<N> for TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>
where TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>: _Mul<N, Output = R, Overflow = O>,

Source§

impl<N: IsInteger, H0: Hex, H1: Hex, H2: Hex, H3: Hex, H4: Hex, H5: Hex, H6: Hex, H7: Hex, R: IsInteger> TypedSub<N> for TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>
where TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>: _Sub<N, Output = R>,

Source§

impl<H0: Copy + Hex, H1: Copy + Hex, H2: Copy + Hex, H3: Copy + Hex, H4: Copy + Hex, H5: Copy + Hex, H6: Copy + Hex, H7: Copy + Hex> Copy for TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>

Source§

impl<N: IsInteger> TypedAssertEqual<N> for TypedInteger<N::Hex0, N::Hex1, N::Hex2, N::Hex3, N::Hex4, N::Hex5, N::Hex6, N::Hex7>

Auto Trait Implementations§

§

impl<H0, H1, H2, H3, H4, H5, H6, H7> Freeze for TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>

§

impl<H0, H1, H2, H3, H4, H5, H6, H7> RefUnwindSafe for TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>

§

impl<H0, H1, H2, H3, H4, H5, H6, H7> Send for TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>
where H0: Send, H1: Send, H2: Send, H3: Send, H4: Send, H5: Send, H6: Send, H7: Send,

§

impl<H0, H1, H2, H3, H4, H5, H6, H7> Sync for TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>
where H0: Sync, H1: Sync, H2: Sync, H3: Sync, H4: Sync, H5: Sync, H6: Sync, H7: Sync,

§

impl<H0, H1, H2, H3, H4, H5, H6, H7> Unpin for TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>
where H0: Unpin, H1: Unpin, H2: Unpin, H3: Unpin, H4: Unpin, H5: Unpin, H6: Unpin, H7: Unpin,

§

impl<H0, H1, H2, H3, H4, H5, H6, H7> UnwindSafe for TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.