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
sourceimpl<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>
sourceimpl<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>
sourceimpl<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>
sourceimpl<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>
sourceimpl<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>
sourceimpl<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>
sourceimpl<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>,
type ArrayType
type ArrayType
Associated type representing the array type for the number
sourceimpl<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>,
type ArrayType
type ArrayType
Associated type representing the array type for the number
sourceimpl<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>,
type ArrayType
type ArrayType
Associated type representing the array type for the number
sourceimpl<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>,
type ArrayType
type ArrayType
Associated type representing the array type for the number
sourceimpl<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.
sourceimpl<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>
sourceimpl<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>
sourceimpl<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>
sourceimpl<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>
sourceimpl<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.
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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>,
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<Xp, Yp> Gcd<UInt<Yp, B1>> for UInt<Xp, B1> where
UInt<Xp, B1>: Max<UInt<Yp, B1>>,
UInt<Xp, B1>: Min<UInt<Yp, B1>>,
UInt<Yp, B1>: Max<UInt<Xp, B1>>,
UInt<Yp, 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>>,
UInt<Xp, B1>: Min<UInt<Yp, B1>>,
UInt<Yp, B1>: Max<UInt<Xp, B1>>,
UInt<Yp, 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.
sourceimpl<Un, Bn, Ui, Bi> GetBit<UInt<Ui, Bi>> for UInt<Un, Bn> where
Un: GetBit<<UInt<Ui, Bi> as Sub<B1>>::Output>,
UInt<Ui, Bi>: Copy,
UInt<Ui, Bi>: Sub<B1>,
impl<Un, Bn, Ui, Bi> GetBit<UInt<Ui, Bi>> for UInt<Un, Bn> where
Un: GetBit<<UInt<Ui, Bi> as Sub<B1>>::Output>,
UInt<Ui, Bi>: Copy,
UInt<Ui, Bi>: Sub<B1>,
sourceimpl<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
sourceimpl<U, B, Ur> Max<Ur> for UInt<U, B> where
U: Unsigned,
B: Bit,
Ur: Unsigned,
UInt<U, B>: Cmp<Ur>,
UInt<U, B>: 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>,
UInt<U, B>: PrivateMax<Ur, <UInt<U, B> as Cmp<Ur>>::Output>,
sourceimpl<U, B, Ur> Min<Ur> for UInt<U, B> where
U: Unsigned,
B: Bit,
Ur: Unsigned,
UInt<U, B>: Cmp<Ur>,
UInt<U, B>: 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>,
UInt<U, B>: PrivateMin<Ur, <UInt<U, B> as Cmp<Ur>>::Output>,
sourceimpl<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>
sourceimpl<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>
sourceimpl<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,
sourceimpl<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>>,
UInt<Ul, Bl>: Rem<UInt<Ur, Br>>,
<UInt<Ul, Bl> as 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>>,
UInt<Ul, Bl>: Rem<UInt<Ur, Br>>,
<UInt<Ul, Bl> as Rem<UInt<Ur, Br>>>::Output == UTerm,
sourceimpl<Ur, Br> PartialDiv<UInt<Ur, Br>> for UTerm where
Ur: Unsigned,
Br: Bit,
impl<Ur, Br> PartialDiv<UInt<Ur, Br>> for UTerm where
Ur: Unsigned,
Br: Bit,
sourcepub fn partial_div(
self,
UInt<Ur, Br>
) -> <UTerm as PartialDiv<UInt<Ur, Br>>>::Output
pub fn partial_div(
self,
UInt<Ur, Br>
) -> <UTerm as PartialDiv<UInt<Ur, Br>>>::Output
Method for performing the division
sourceimpl<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>,
sourcepub fn partial_cmp(&self, other: &UInt<U, B>) -> Option<Ordering>
pub fn partial_cmp(&self, other: &UInt<U, B>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<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>,
sourceimpl<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
sourceimpl<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>
sourceimpl<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)
sourceimpl<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>
sourceimpl<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
sourceimpl<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
sourceimpl<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)
sourceimpl<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>
sourceimpl<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>
sourceimpl<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>
sourceimpl<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.
sourceimpl<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,
pub const U8: u8
pub const U16: u16
pub const U32: u32
pub const U64: u64
pub const USIZE: usize
pub const I8: i8
pub const I16: i16
pub const I32: i32
pub const I64: i64
pub const ISIZE: isize
pub fn to_u8() -> u8
pub fn to_u16() -> u16
pub fn to_u32() -> u32
pub fn to_u64() -> u64
pub fn to_usize() -> usize
pub fn to_i8() -> i8
pub fn to_i16() -> i16
pub fn to_i32() -> i32
pub fn to_i64() -> i64
pub 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 PowerOfTwo for UInt<UTerm, B1>
impl<U> PowerOfTwo for UInt<U, B0> where
U: Unsigned + PowerOfTwo,
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallHasher for T where
T: Hash + ?Sized,
impl<T> CallHasher for T where
T: Hash + ?Sized,
sourceimpl<X> Gcd<UTerm> for X where
X: Unsigned + NonZero,
impl<X> Gcd<UTerm> for X where
X: Unsigned + NonZero,
type Output = X
type Output = X
The greatest common divisor.
sourceimpl<N> Logarithm2 for N where
N: PrivateLogarithm2,
impl<N> Logarithm2 for N where
N: PrivateLogarithm2,
type Output = <N as PrivateLogarithm2>::Output
type Output = <N as PrivateLogarithm2>::Output
The result of the integer binary logarithm.
sourceimpl<N, I, B> SetBit<I, B> for N where
N: PrivateSetBit<I, B>,
<N as PrivateSetBit<I, B>>::Output: Trim,
impl<N, I, B> SetBit<I, B> for N where
N: PrivateSetBit<I, B>,
<N as PrivateSetBit<I, B>>::Output: Trim,
sourceimpl<N> SquareRoot for N where
N: PrivateSquareRoot,
impl<N> SquareRoot for N where
N: PrivateSquareRoot,
type Output = <N as PrivateSquareRoot>::Output
type Output = <N as PrivateSquareRoot>::Output
The result of the integer square root.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more