pub struct UInt<U, B> { /* private fields */ }Expand description
UInt is defined recursively, where B is the least significant bit and U is the rest
of the number. Conceptually, U should be bound by the trait Unsigned and B should
be bound by the trait Bit, but enforcing these bounds causes linear instead of
logrithmic scaling in some places, so they are left off for now. They may be enforced in
future.
In order to keep numbers unique, leading zeros are not allowed, so UInt<UTerm, B0> is
forbidden.
Example
use typenum::{UInt, UTerm, B0, B1};
type U6 = UInt<UInt<UInt<UTerm, B1>, B1>, B0>;Implementations§
Trait Implementations§
source§impl<U> Add<B1> for UInt<U, B1>where
    U: Unsigned + Add<B1>,
    <U as Add<B1>>::Output: Unsigned,
 
impl<U> Add<B1> for UInt<U, B1>where
    U: Unsigned + Add<B1>,
    <U as Add<B1>>::Output: Unsigned,
UInt<U, B1> + B1 = UInt<U + B1, B0>
source§impl<Ul, Ur> Add<UInt<Ur, B0>> for UInt<Ul, B0>where
    Ul: Unsigned + Add<Ur>,
    Ur: Unsigned,
 
impl<Ul, Ur> Add<UInt<Ur, B0>> for UInt<Ul, B0>where
    Ul: Unsigned + Add<Ur>,
    Ur: Unsigned,
UInt<Ul, B0> + UInt<Ur, B0> = UInt<Ul + Ur, B0>
source§impl<Ul, Ur> Add<UInt<Ur, B0>> for UInt<Ul, B1>where
    Ul: Unsigned + Add<Ur>,
    Ur: Unsigned,
 
impl<Ul, Ur> Add<UInt<Ur, B0>> for UInt<Ul, B1>where
    Ul: Unsigned + Add<Ur>,
    Ur: Unsigned,
UInt<Ul, B1> + UInt<Ur, B0> = UInt<Ul + Ur, B1>
source§impl<Ul, Ur> Add<UInt<Ur, B1>> for UInt<Ul, B0>where
    Ul: Unsigned + Add<Ur>,
    Ur: Unsigned,
 
impl<Ul, Ur> Add<UInt<Ur, B1>> for UInt<Ul, B0>where
    Ul: Unsigned + Add<Ur>,
    Ur: Unsigned,
UInt<Ul, B0> + UInt<Ur, B1> = UInt<Ul + Ur, B1>
source§impl<Ul, Ur> Add<UInt<Ur, B1>> for UInt<Ul, B1>where
    Ul: Unsigned + Add<Ur>,
    Ur: Unsigned,
    <Ul as Add<Ur>>::Output: Add<B1>,
 
impl<Ul, Ur> Add<UInt<Ur, B1>> for UInt<Ul, B1>where
    Ul: Unsigned + Add<Ur>,
    Ur: Unsigned,
    <Ul as Add<Ur>>::Output: Add<B1>,
UInt<Ul, B1> + UInt<Ur, B1> = UInt<(Ul + Ur) + B1, B0>
source§impl<U, B> Add<UTerm> for UInt<U, B>where
    U: Unsigned,
    B: Bit,
 
impl<U, B> Add<UTerm> for UInt<U, B>where
    U: Unsigned,
    B: Bit,
UInt<U, B> + UTerm = UInt<U, B>
source§impl<T, N> ArrayLength<T> for UInt<N, B0>where
    N: ArrayLength<T>,
 
impl<T, N> ArrayLength<T> for UInt<N, B0>where
    N: ArrayLength<T>,
source§impl<T, N> ArrayLength<T> for UInt<N, B0>where
    N: ArrayLength<T>,
 
impl<T, N> ArrayLength<T> for UInt<N, B0>where
    N: ArrayLength<T>,
source§impl<T, N> ArrayLength<T> for UInt<N, B1>where
    N: ArrayLength<T>,
 
impl<T, N> ArrayLength<T> for UInt<N, B1>where
    N: ArrayLength<T>,
source§impl<T, N> ArrayLength<T> for UInt<N, B1>where
    N: ArrayLength<T>,
 
impl<T, N> ArrayLength<T> for UInt<N, B1>where
    N: ArrayLength<T>,
source§impl<Ul, Bl, Ur> BitAnd<Ur> for UInt<Ul, Bl>where
    Ul: Unsigned,
    Bl: Bit,
    Ur: Unsigned,
    UInt<Ul, Bl>: PrivateAnd<Ur>,
    <UInt<Ul, Bl> as PrivateAnd<Ur>>::Output: Trim,
 
impl<Ul, Bl, Ur> BitAnd<Ur> for UInt<Ul, Bl>where
    Ul: Unsigned,
    Bl: Bit,
    Ur: Unsigned,
    UInt<Ul, Bl>: PrivateAnd<Ur>,
    <UInt<Ul, Bl> as PrivateAnd<Ur>>::Output: Trim,
Anding unsigned integers.
We use our PrivateAnd operator and then Trim the output.
source§impl<Ul, Ur> BitOr<UInt<Ur, B0>> for UInt<Ul, B0>where
    Ul: Unsigned + BitOr<Ur>,
    Ur: Unsigned,
 
impl<Ul, Ur> BitOr<UInt<Ur, B0>> for UInt<Ul, B0>where
    Ul: Unsigned + BitOr<Ur>,
    Ur: Unsigned,
UInt<Ul, B0> | UInt<Ur, B0> = UInt<Ul | Ur, B0>
source§impl<Ul, Ur> BitOr<UInt<Ur, B0>> for UInt<Ul, B1>where
    Ul: Unsigned + BitOr<Ur>,
    Ur: Unsigned,
 
impl<Ul, Ur> BitOr<UInt<Ur, B0>> for UInt<Ul, B1>where
    Ul: Unsigned + BitOr<Ur>,
    Ur: Unsigned,
UInt<Ul, B1> | UInt<Ur, B0> = UInt<Ul | Ur, B1>
source§impl<Ul, Ur> BitOr<UInt<Ur, B1>> for UInt<Ul, B0>where
    Ul: Unsigned + BitOr<Ur>,
    Ur: Unsigned,
 
impl<Ul, Ur> BitOr<UInt<Ur, B1>> for UInt<Ul, B0>where
    Ul: Unsigned + BitOr<Ur>,
    Ur: Unsigned,
UInt<Ul, B0> | UInt<Ur, B1> = UInt<Ul | Ur, B1>
source§impl<Ul, Ur> BitOr<UInt<Ur, B1>> for UInt<Ul, B1>where
    Ul: Unsigned + BitOr<Ur>,
    Ur: Unsigned,
 
impl<Ul, Ur> BitOr<UInt<Ur, B1>> for UInt<Ul, B1>where
    Ul: Unsigned + BitOr<Ur>,
    Ur: Unsigned,
UInt<Ul, B1> | UInt<Ur, B1> = UInt<Ul | Ur, B1>
source§impl<Ul, Bl, Ur> BitXor<Ur> for UInt<Ul, Bl>where
    Ul: Unsigned,
    Bl: Bit,
    Ur: Unsigned,
    UInt<Ul, Bl>: PrivateXor<Ur>,
    <UInt<Ul, Bl> as PrivateXor<Ur>>::Output: Trim,
 
impl<Ul, Bl, Ur> BitXor<Ur> for UInt<Ul, Bl>where
    Ul: Unsigned,
    Bl: Bit,
    Ur: Unsigned,
    UInt<Ul, Bl>: PrivateXor<Ur>,
    <UInt<Ul, Bl> as PrivateXor<Ur>>::Output: Trim,
Xoring unsigned integers.
We use our PrivateXor operator and then Trim the output.
source§impl<Ul, Ur> Cmp<UInt<Ur, B0>> for UInt<Ul, B0>where
    Ul: Unsigned + PrivateCmp<Ur, Equal>,
    Ur: Unsigned,
 
impl<Ul, Ur> Cmp<UInt<Ur, B0>> for UInt<Ul, B0>where
    Ul: Unsigned + PrivateCmp<Ur, Equal>,
    Ur: Unsigned,
UInt<Ul, B0> cmp with UInt<Ur, B0>: SoFar is Equal
source§impl<Ul, Ur> Cmp<UInt<Ur, B0>> for UInt<Ul, B1>where
    Ul: Unsigned + PrivateCmp<Ur, Greater>,
    Ur: Unsigned,
 
impl<Ul, Ur> Cmp<UInt<Ur, B0>> for UInt<Ul, B1>where
    Ul: Unsigned + PrivateCmp<Ur, Greater>,
    Ur: Unsigned,
UInt<Ul, B1> cmp with UInt<Ur, B0>: SoFar is Greater
source§impl<Ul, Ur> Cmp<UInt<Ur, B1>> for UInt<Ul, B0>where
    Ul: Unsigned + PrivateCmp<Ur, Less>,
    Ur: Unsigned,
 
impl<Ul, Ur> Cmp<UInt<Ur, B1>> for UInt<Ul, B0>where
    Ul: Unsigned + PrivateCmp<Ur, Less>,
    Ur: Unsigned,
UInt<Ul, B0> cmp with UInt<Ur, B1>: SoFar is Less
source§impl<Ul, Ur> Cmp<UInt<Ur, B1>> for UInt<Ul, B1>where
    Ul: Unsigned + PrivateCmp<Ur, Equal>,
    Ur: Unsigned,
 
impl<Ul, Ur> Cmp<UInt<Ur, B1>> for UInt<Ul, B1>where
    Ul: Unsigned + PrivateCmp<Ur, Equal>,
    Ur: Unsigned,
UInt<Ul, B1> cmp with UInt<Ur, B1>: SoFar is Equal
source§impl<Ul, Bl, Ur, Br> Div<UInt<Ur, Br>> for UInt<Ul, Bl>where
    Ul: Unsigned,
    Bl: Bit,
    Ur: Unsigned,
    Br: Bit,
    UInt<Ul, Bl>: Len,
    <UInt<Ul, Bl> as Len>::Output: Sub<B1>,
    (): PrivateDiv<UInt<Ul, Bl>, UInt<Ur, Br>, UTerm, UTerm, <<UInt<Ul, Bl> as Len>::Output as Sub<B1>>::Output>,
 
impl<Ul, Bl, Ur, Br> Div<UInt<Ur, Br>> for UInt<Ul, Bl>where
    Ul: Unsigned,
    Bl: Bit,
    Ur: Unsigned,
    Br: Bit,
    UInt<Ul, Bl>: Len,
    <UInt<Ul, Bl> as Len>::Output: Sub<B1>,
    (): PrivateDiv<UInt<Ul, Bl>, UInt<Ur, Br>, UTerm, UTerm, <<UInt<Ul, Bl> as Len>::Output as Sub<B1>>::Output>,
source§impl<Xp, Yp> Gcd<UInt<Yp, B0>> for UInt<Xp, B0>where
    Xp: Gcd<Yp>,
    UInt<Xp, B0>: NonZero,
    UInt<Yp, B0>: NonZero,
 
impl<Xp, Yp> Gcd<UInt<Yp, B0>> for UInt<Xp, B0>where
    Xp: Gcd<Yp>,
    UInt<Xp, B0>: NonZero,
    UInt<Yp, B0>: NonZero,
gcd(x, y) = 2*gcd(x/2, y/2) if both x and y even
source§impl<Xp, Yp> Gcd<UInt<Yp, B0>> for UInt<Xp, B1>where
    UInt<Xp, B1>: Gcd<Yp>,
    UInt<Yp, B0>: NonZero,
 
impl<Xp, Yp> Gcd<UInt<Yp, B0>> for UInt<Xp, B1>where
    UInt<Xp, B1>: Gcd<Yp>,
    UInt<Yp, B0>: NonZero,
gcd(x, y) = gcd(x, y/2) if x odd and y even
source§impl<Xp, Yp> Gcd<UInt<Yp, B1>> for UInt<Xp, B0>where
    Xp: Gcd<UInt<Yp, B1>>,
    UInt<Xp, B0>: NonZero,
 
impl<Xp, Yp> Gcd<UInt<Yp, B1>> for UInt<Xp, B0>where
    Xp: Gcd<UInt<Yp, B1>>,
    UInt<Xp, B0>: NonZero,
gcd(x, y) = gcd(x/2, y) if x even and y odd
source§impl<Xp, Yp> Gcd<UInt<Yp, B1>> for UInt<Xp, B1>where
    UInt<Xp, B1>: Max<UInt<Yp, B1>> + Min<UInt<Yp, B1>>,
    UInt<Yp, B1>: Max<UInt<Xp, B1>> + Min<UInt<Xp, B1>>,
    <UInt<Xp, B1> as Max<UInt<Yp, B1>>>::Output: Sub<<UInt<Xp, B1> as Min<UInt<Yp, B1>>>::Output>,
    <<UInt<Xp, B1> as Max<UInt<Yp, B1>>>::Output as Sub<<UInt<Xp, B1> as Min<UInt<Yp, B1>>>::Output>>::Output: Gcd<<UInt<Xp, B1> as Min<UInt<Yp, B1>>>::Output>,
 
impl<Xp, Yp> Gcd<UInt<Yp, B1>> for UInt<Xp, B1>where
    UInt<Xp, B1>: Max<UInt<Yp, B1>> + Min<UInt<Yp, B1>>,
    UInt<Yp, B1>: Max<UInt<Xp, B1>> + Min<UInt<Xp, B1>>,
    <UInt<Xp, B1> as Max<UInt<Yp, B1>>>::Output: Sub<<UInt<Xp, B1> as Min<UInt<Yp, B1>>>::Output>,
    <<UInt<Xp, B1> as Max<UInt<Yp, B1>>>::Output as Sub<<UInt<Xp, B1> as Min<UInt<Yp, B1>>>::Output>>::Output: Gcd<<UInt<Xp, B1> as Min<UInt<Yp, B1>>>::Output>,
gcd(x, y) = gcd([max(x, y) - min(x, y)], min(x, y)) if both x and y odd
This will immediately invoke the case for x even and y odd because the difference of two odd numbers is an even number.
source§impl<Un, Bn, Ui, Bi> GetBit<UInt<Ui, Bi>> for UInt<Un, Bn>where
    UInt<Ui, Bi>: Copy + Sub<B1>,
    Un: GetBit<<UInt<Ui, Bi> as Sub<B1>>::Output>,
 
impl<Un, Bn, Ui, Bi> GetBit<UInt<Ui, Bi>> for UInt<Un, Bn>where
    UInt<Ui, Bi>: Copy + Sub<B1>,
    Un: GetBit<<UInt<Ui, Bi> as Sub<B1>>::Output>,
source§impl<U, B> Len for UInt<U, B>where
    U: Unsigned + Len,
    B: Bit,
    <U as Len>::Output: Add<B1>,
    <<U as Len>::Output as Add<B1>>::Output: Unsigned,
 
impl<U, B> Len for UInt<U, B>where
    U: Unsigned + Len,
    B: Bit,
    <U as Len>::Output: Add<B1>,
    <<U as Len>::Output as Add<B1>>::Output: Unsigned,
Length of a bit is 1
source§impl<U, B, Ur> Max<Ur> for UInt<U, B>where
    U: Unsigned,
    B: Bit,
    Ur: Unsigned,
    UInt<U, B>: Cmp<Ur> + PrivateMax<Ur, <UInt<U, B> as Cmp<Ur>>::Output>,
 
impl<U, B, Ur> Max<Ur> for UInt<U, B>where
    U: Unsigned,
    B: Bit,
    Ur: Unsigned,
    UInt<U, B>: Cmp<Ur> + PrivateMax<Ur, <UInt<U, B> as Cmp<Ur>>::Output>,
source§impl<U, B, Ur> Min<Ur> for UInt<U, B>where
    U: Unsigned,
    B: Bit,
    Ur: Unsigned,
    UInt<U, B>: Cmp<Ur> + PrivateMin<Ur, <UInt<U, B> as Cmp<Ur>>::Output>,
 
impl<U, B, Ur> Min<Ur> for UInt<U, B>where
    U: Unsigned,
    B: Bit,
    Ur: Unsigned,
    UInt<U, B>: Cmp<Ur> + PrivateMin<Ur, <UInt<U, B> as Cmp<Ur>>::Output>,
source§impl<Ul, B, Ur> Mul<UInt<Ur, B>> for UInt<Ul, B0>where
    Ul: Unsigned + Mul<UInt<Ur, B>>,
    B: Bit,
    Ur: Unsigned,
 
impl<Ul, B, Ur> Mul<UInt<Ur, B>> for UInt<Ul, B0>where
    Ul: Unsigned + Mul<UInt<Ur, B>>,
    B: Bit,
    Ur: Unsigned,
UInt<Ul, B0> * UInt<Ur, B> = UInt<(Ul * UInt<Ur, B>), B0>
source§impl<Ul, B, Ur> Mul<UInt<Ur, B>> for UInt<Ul, B1>where
    Ul: Unsigned + Mul<UInt<Ur, B>>,
    B: Bit,
    Ur: Unsigned,
    UInt<<Ul as Mul<UInt<Ur, B>>>::Output, B0>: Add<UInt<Ur, B>>,
 
impl<Ul, B, Ur> Mul<UInt<Ur, B>> for UInt<Ul, B1>where
    Ul: Unsigned + Mul<UInt<Ur, B>>,
    B: Bit,
    Ur: Unsigned,
    UInt<<Ul as Mul<UInt<Ur, B>>>::Output, B0>: Add<UInt<Ur, B>>,
UInt<Ul, B1> * UInt<Ur, B> = UInt<(Ul * UInt<Ur, B>), B0> + UInt<Ur, B>
source§impl<U, B> Ord for UInt<U, B>where
    U: Ord,
    B: Ord,
 
impl<U, B> Ord for UInt<U, B>where
    U: Ord,
    B: Ord,
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
    Self: Sized,
 
fn max(self, other: Self) -> Selfwhere
    Self: Sized,
source§impl<Ul, Bl, Ur, Br> PartialDiv<UInt<Ur, Br>> for UInt<Ul, Bl>where
    Ul: Unsigned,
    Bl: Bit,
    Ur: Unsigned,
    Br: Bit,
    UInt<Ul, Bl>: Div<UInt<Ur, Br>> + Rem<UInt<Ur, Br>, Output = UTerm>,
 
impl<Ul, Bl, Ur, Br> PartialDiv<UInt<Ur, Br>> for UInt<Ul, Bl>where
    Ul: Unsigned,
    Bl: Bit,
    Ur: Unsigned,
    Br: Bit,
    UInt<Ul, Bl>: Div<UInt<Ur, Br>> + Rem<UInt<Ur, Br>, Output = UTerm>,
source§impl<U, B> PartialEq<UInt<U, B>> for UInt<U, B>where
    U: PartialEq<U>,
    B: PartialEq<B>,
 
impl<U, B> PartialEq<UInt<U, B>> for UInt<U, B>where
    U: PartialEq<U>,
    B: PartialEq<B>,
source§impl<U, B> PartialOrd<UInt<U, B>> for UInt<U, B>where
    U: PartialOrd<U>,
    B: PartialOrd<B>,
 
impl<U, B> PartialOrd<UInt<U, B>> for UInt<U, B>where
    U: PartialOrd<U>,
    B: PartialOrd<B>,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
 
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresource§impl<Ul, Bl, Ur, Br> Rem<UInt<Ur, Br>> for UInt<Ul, Bl>where
    Ul: Unsigned,
    Bl: Bit,
    Ur: Unsigned,
    Br: Bit,
    UInt<Ul, Bl>: Len,
    <UInt<Ul, Bl> as Len>::Output: Sub<B1>,
    (): PrivateDiv<UInt<Ul, Bl>, UInt<Ur, Br>, UTerm, UTerm, <<UInt<Ul, Bl> as Len>::Output as Sub<B1>>::Output>,
 
impl<Ul, Bl, Ur, Br> Rem<UInt<Ur, Br>> for UInt<Ul, Bl>where
    Ul: Unsigned,
    Bl: Bit,
    Ur: Unsigned,
    Br: Bit,
    UInt<Ul, Bl>: Len,
    <UInt<Ul, Bl> as Len>::Output: Sub<B1>,
    (): PrivateDiv<UInt<Ul, Bl>, UInt<Ur, Br>, UTerm, UTerm, <<UInt<Ul, Bl> as Len>::Output as Sub<B1>>::Output>,
source§impl<U, B> Shl<B0> for UInt<U, B>where
    U: Unsigned,
    B: Bit,
 
impl<U, B> Shl<B0> for UInt<U, B>where
    U: Unsigned,
    B: Bit,
Shifting left any unsigned by a zero bit: U << B0 = U
source§impl<U, B> Shl<B1> for UInt<U, B>where
    U: Unsigned,
    B: Bit,
 
impl<U, B> Shl<B1> for UInt<U, B>where
    U: Unsigned,
    B: Bit,
Shifting left a UInt by a one bit: UInt<U, B> << B1 = UInt<UInt<U, B>, B0>
source§impl<U, B, Ur, Br> Shl<UInt<Ur, Br>> for UInt<U, B>where
    U: Unsigned,
    B: Bit,
    Ur: Unsigned,
    Br: Bit,
    UInt<Ur, Br>: Sub<B1>,
    UInt<UInt<U, B>, B0>: Shl<<UInt<Ur, Br> as Sub<B1>>::Output>,
 
impl<U, B, Ur, Br> Shl<UInt<Ur, Br>> for UInt<U, B>where
    U: Unsigned,
    B: Bit,
    Ur: Unsigned,
    Br: Bit,
    UInt<Ur, Br>: Sub<B1>,
    UInt<UInt<U, B>, B0>: Shl<<UInt<Ur, Br> as Sub<B1>>::Output>,
Shifting left UInt by UInt: X << Y = UInt(X, B0) << (Y - 1)
source§impl<U, B> Shl<UTerm> for UInt<U, B>where
    U: Unsigned,
    B: Bit,
 
impl<U, B> Shl<UTerm> for UInt<U, B>where
    U: Unsigned,
    B: Bit,
Shifting left UInt by UTerm: UInt<U, B> << UTerm = UInt<U, B>
source§impl<U, B> Shr<B0> for UInt<U, B>where
    U: Unsigned,
    B: Bit,
 
impl<U, B> Shr<B0> for UInt<U, B>where
    U: Unsigned,
    B: Bit,
Shifting right any unsigned by a zero bit: U >> B0 = U
source§impl<U, B> Shr<B1> for UInt<U, B>where
    U: Unsigned,
    B: Bit,
 
impl<U, B> Shr<B1> for UInt<U, B>where
    U: Unsigned,
    B: Bit,
Shifting right a UInt by a 1 bit: UInt<U, B> >> B1 = U
source§impl<U, B, Ur, Br> Shr<UInt<Ur, Br>> for UInt<U, B>where
    U: Unsigned + Shr<<UInt<Ur, Br> as Sub<B1>>::Output>,
    B: Bit,
    Ur: Unsigned,
    Br: Bit,
    UInt<Ur, Br>: Sub<B1>,
 
impl<U, B, Ur, Br> Shr<UInt<Ur, Br>> for UInt<U, B>where
    U: Unsigned + Shr<<UInt<Ur, Br> as Sub<B1>>::Output>,
    B: Bit,
    Ur: Unsigned,
    Br: Bit,
    UInt<Ur, Br>: Sub<B1>,
Shifting right UInt by UInt: UInt(U, B) >> Y = U >> (Y - 1)
source§impl<U, B> Shr<UTerm> for UInt<U, B>where
    U: Unsigned,
    B: Bit,
 
impl<U, B> Shr<UTerm> for UInt<U, B>where
    U: Unsigned,
    B: Bit,
Shifting right UInt by UTerm: UInt<U, B> >> UTerm = UInt<U, B>
source§impl<U> Sub<B1> for UInt<U, B0>where
    U: Unsigned + Sub<B1>,
    <U as Sub<B1>>::Output: Unsigned,
 
impl<U> Sub<B1> for UInt<U, B0>where
    U: Unsigned + Sub<B1>,
    <U as Sub<B1>>::Output: Unsigned,
UInt<U, B0> - B1 = UInt<U - B1, B1>
source§impl<U, B> Sub<B1> for UInt<UInt<U, B>, B1>where
    U: Unsigned,
    B: Bit,
 
impl<U, B> Sub<B1> for UInt<UInt<U, B>, B1>where
    U: Unsigned,
    B: Bit,
UInt<U, B1> - B1 = UInt<U, B0>
source§impl<Ul, Bl, Ur> Sub<Ur> for UInt<Ul, Bl>where
    Ul: Unsigned,
    Bl: Bit,
    Ur: Unsigned,
    UInt<Ul, Bl>: PrivateSub<Ur>,
    <UInt<Ul, Bl> as PrivateSub<Ur>>::Output: Trim,
 
impl<Ul, Bl, Ur> Sub<Ur> for UInt<Ul, Bl>where
    Ul: Unsigned,
    Bl: Bit,
    Ur: Unsigned,
    UInt<Ul, Bl>: PrivateSub<Ur>,
    <UInt<Ul, Bl> as PrivateSub<Ur>>::Output: Trim,
Subtracting unsigned integers. We just do our PrivateSub and then Trim the output.
source§impl<U, B> Unsigned for UInt<U, B>where
    U: Unsigned,
    B: Bit,
 
impl<U, B> Unsigned for UInt<U, B>where
    U: Unsigned,
    B: Bit,
const U8: u8 = B::U8 | U::U8 << 1
const U16: u16 = B::U8 as u16 | U::U16 << 1
const U32: u32 = B::U8 as u32 | U::U32 << 1
const U64: u64 = B::U8 as u64 | U::U64 << 1
const USIZE: usize = B::U8 as usize | U::USIZE << 1
const I8: i8 = B::U8 as i8 | U::I8 << 1
const I16: i16 = B::U8 as i16 | U::I16 << 1
const I32: i32 = B::U8 as i32 | U::I32 << 1
const I64: i64 = B::U8 as i64 | U::I64 << 1
const ISIZE: isize = B::U8 as isize | U::ISIZE << 1
fn to_u8() -> u8
fn to_u16() -> u16
fn to_u32() -> u32
fn to_u64() -> u64
fn to_usize() -> usize
fn to_i8() -> i8
fn to_i16() -> i16
fn to_i32() -> i32
fn to_i64() -> i64
fn to_isize() -> isize
impl<U, B> Copy for UInt<U, B>where
    U: Copy,
    B: Copy,
impl<U, B> Eq for UInt<U, B>where
    U: Eq,
    B: Eq,
impl<U, B> NonZero for UInt<U, B>where
    U: Unsigned,
    B: Bit,
impl<U> PowerOfTwo for UInt<U, B0>where
    U: Unsigned + PowerOfTwo,
impl PowerOfTwo for UInt<UTerm, B1>
impl<U, B> StructuralEq for UInt<U, B>
impl<U, B> StructuralPartialEq for UInt<U, B>
Auto Trait Implementations§
impl<U, B> RefUnwindSafe for UInt<U, B>where
    B: RefUnwindSafe,
    U: RefUnwindSafe,
impl<U, B> Send for UInt<U, B>where
    B: Send,
    U: Send,
impl<U, B> Sync for UInt<U, B>where
    B: Sync,
    U: Sync,
impl<U, B> Unpin for UInt<U, B>where
    B: Unpin,
    U: Unpin,
impl<U, B> UnwindSafe for UInt<U, B>where
    B: UnwindSafe,
    U: UnwindSafe,
Blanket Implementations§
source§impl<T> CallHasher for Twhere
    T: Hash + ?Sized,
 
impl<T> CallHasher for Twhere
    T: Hash + ?Sized,
source§impl<T> Downcast for Twhere
    T: Any,
 
impl<T> Downcast for Twhere
    T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
 
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read moresource§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
 
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read moresource§fn as_any(&self) -> &(dyn Any + 'static)
 
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s. Read moresource§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
 
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s. Read moresource§impl<Q, K> Equivalent<K> for Qwhere
    Q: Eq + ?Sized,
    K: Borrow<Q> + ?Sized,
 
impl<Q, K> Equivalent<K> for Qwhere
    Q: Eq + ?Sized,
    K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.source§impl<T> FmtForward for T
 
impl<T> FmtForward for T
source§fn fmt_binary(self) -> FmtBinary<Self>where
    Self: Binary,
 
fn fmt_binary(self) -> FmtBinary<Self>where
    Self: Binary,
self to use its Binary implementation when Debug-formatted.source§fn fmt_display(self) -> FmtDisplay<Self>where
    Self: Display,
 
fn fmt_display(self) -> FmtDisplay<Self>where
    Self: Display,
source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
    Self: LowerExp,
 
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
    Self: LowerExp,
source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
    Self: LowerHex,
 
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
    Self: LowerHex,
source§fn fmt_octal(self) -> FmtOctal<Self>where
    Self: Octal,
 
fn fmt_octal(self) -> FmtOctal<Self>where
    Self: Octal,
self to use its Octal implementation when Debug-formatted.source§fn fmt_pointer(self) -> FmtPointer<Self>where
    Self: Pointer,
 
fn fmt_pointer(self) -> FmtPointer<Self>where
    Self: Pointer,
source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
    Self: UpperExp,
 
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
    Self: UpperExp,
source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
    Self: UpperHex,
 
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
    Self: UpperHex,
source§impl<T> Instrument for T
 
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
 
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
 
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
    Outer: AsRef<T> + AsMut<T> + From<T>,
    T: From<Outer>,
 
impl<T, Outer> IsWrappedBy<Outer> for Twhere
    Outer: AsRef<T> + AsMut<T> + From<T>,
    T: From<Outer>,
source§impl<N> Logarithm2 for Nwhere
    N: PrivateLogarithm2,
 
impl<N> Logarithm2 for Nwhere
    N: PrivateLogarithm2,
source§impl<T> Pipe for Twhere
    T: ?Sized,
 
impl<T> Pipe for Twhere
    T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
    Self: Sized,
 
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
    Self: Sized,
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
    R: 'a,
 
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
    R: 'a,
self and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
    R: 'a,
 
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
    R: 'a,
self and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
    Self: Borrow<B>,
    B: 'a + ?Sized,
    R: 'a,
 
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
    Self: Borrow<B>,
    B: 'a + ?Sized,
    R: 'a,
source§fn pipe_borrow_mut<'a, B, R>(
    &'a mut self,
    func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
    Self: BorrowMut<B>,
    B: 'a + ?Sized,
    R: 'a,
 
fn pipe_borrow_mut<'a, B, R>(
    &'a mut self,
    func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
    Self: BorrowMut<B>,
    B: 'a + ?Sized,
    R: 'a,
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
    Self: AsRef<U>,
    U: 'a + ?Sized,
    R: 'a,
 
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
    Self: AsRef<U>,
    U: 'a + ?Sized,
    R: 'a,
self, then passes self.as_ref() into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
    Self: AsMut<U>,
    U: 'a + ?Sized,
    R: 'a,
 
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
    Self: AsMut<U>,
    U: 'a + ?Sized,
    R: 'a,
source§impl<N, I, B> SetBit<I, B> for Nwhere
    N: PrivateSetBit<I, B>,
    <N as PrivateSetBit<I, B>>::Output: Trim,
 
impl<N, I, B> SetBit<I, B> for Nwhere
    N: PrivateSetBit<I, B>,
    <N as PrivateSetBit<I, B>>::Output: Trim,
source§impl<N> SquareRoot for Nwhere
    N: PrivateSquareRoot,
 
impl<N> SquareRoot for Nwhere
    N: PrivateSquareRoot,
source§impl<T> Tap for T
 
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
    Self: Borrow<B>,
    B: ?Sized,
 
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
    Self: Borrow<B>,
    B: ?Sized,
Borrow<B> of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
    Self: BorrowMut<B>,
    B: ?Sized,
 
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
    Self: BorrowMut<B>,
    B: ?Sized,
BorrowMut<B> of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
    Self: AsRef<R>,
    R: ?Sized,
 
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
    Self: AsRef<R>,
    R: ?Sized,
AsRef<R> view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
    Self: AsMut<R>,
    R: ?Sized,
 
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
    Self: AsMut<R>,
    R: ?Sized,
AsMut<R> view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
    Self: Deref<Target = T>,
    T: ?Sized,
 
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
    Self: Deref<Target = T>,
    T: ?Sized,
Deref::Target of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
    Self: DerefMut<Target = T> + Deref,
    T: ?Sized,
 
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
    Self: DerefMut<Target = T> + Deref,
    T: ?Sized,
Deref::Target of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
 
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
 
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds. Read moresource§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
    Self: Borrow<B>,
    B: ?Sized,
 
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
    Self: Borrow<B>,
    B: ?Sized,
.tap_borrow() only in debug builds, and is erased in release
builds. Read moresource§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
    Self: BorrowMut<B>,
    B: ?Sized,
 
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
    Self: BorrowMut<B>,
    B: ?Sized,
.tap_borrow_mut() only in debug builds, and is erased in release
builds. Read moresource§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
    Self: AsRef<R>,
    R: ?Sized,
 
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
    Self: AsRef<R>,
    R: ?Sized,
.tap_ref() only in debug builds, and is erased in release
builds. Read moresource§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
    Self: AsMut<R>,
    R: ?Sized,
 
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
    Self: AsMut<R>,
    R: ?Sized,
.tap_ref_mut() only in debug builds, and is erased in release
builds. Read moresource§impl<S, T> UncheckedInto<T> for Swhere
    T: UncheckedFrom<S>,
 
impl<S, T> UncheckedInto<T> for Swhere
    T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
 
fn unchecked_into(self) -> T
unchecked_from.