pub struct TypedInteger<H0: Hex, H1: Hex, H2: Hex, H3: Hex, H4: Hex, H5: Hex, H6: Hex, H7: Hex> { /* private fields */ }
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>

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 new() -> Self

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 copy of the value. Read more
1.0.0 · source§

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>

§

type Hex0 = H0

§

type Hex1 = H1

§

type Hex2 = H2

§

type Hex3 = H3

§

type Hex4 = H4

§

type Hex5 = H5

§

type Hex6 = H6

§

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>,

§

type 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>,

§

type Output = R

§

type 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,

§

type Output = R

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>,

§

type 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>,

§

type 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>,

§

type 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>,

§

type 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>,

§

type Output = R

§

type 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>,

§

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

§

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>where H0: UnwindSafe, H1: UnwindSafe, H2: UnwindSafe, H3: UnwindSafe, H4: UnwindSafe, H5: UnwindSafe, H6: UnwindSafe, H7: 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> ToOwned for Twhere T: Clone,

§

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 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.