Struct Wrapping
pub struct Wrapping<T>(pub T);Expand description
Provides intentionally-wrapped arithmetic on T.
This is analogous to core::num::Wrapping but allows this crate to
define trait impls for this type.
Tuple Fields§
§0: TTrait Implementations§
§impl AddAssign<&Wrapping<Limb>> for Wrapping<Limb>
impl AddAssign<&Wrapping<Limb>> for Wrapping<Limb>
§fn add_assign(&mut self, other: &Wrapping<Limb>)
fn add_assign(&mut self, other: &Wrapping<Limb>)
Performs the
+= operation. Read more§impl<const LIMBS: usize> AddAssign<&Wrapping<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> AddAssign<&Wrapping<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
§fn add_assign(&mut self, other: &Wrapping<Uint<LIMBS>>)
fn add_assign(&mut self, other: &Wrapping<Uint<LIMBS>>)
Performs the
+= operation. Read more§impl AddAssign for Wrapping<Limb>
impl AddAssign for Wrapping<Limb>
§fn add_assign(&mut self, other: Wrapping<Limb>)
fn add_assign(&mut self, other: Wrapping<Limb>)
Performs the
+= operation. Read more§impl<const LIMBS: usize> AddAssign for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> AddAssign for Wrapping<Uint<LIMBS>>
§fn add_assign(&mut self, other: Wrapping<Uint<LIMBS>>)
fn add_assign(&mut self, other: Wrapping<Uint<LIMBS>>)
Performs the
+= operation. Read more§impl<const LIMBS: usize> BitAndAssign<&Wrapping<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> BitAndAssign<&Wrapping<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
§fn bitand_assign(&mut self, other: &Wrapping<Uint<LIMBS>>)
fn bitand_assign(&mut self, other: &Wrapping<Uint<LIMBS>>)
Performs the
&= operation. Read more§impl<const LIMBS: usize> BitAndAssign for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> BitAndAssign for Wrapping<Uint<LIMBS>>
§fn bitand_assign(&mut self, other: Wrapping<Uint<LIMBS>>)
fn bitand_assign(&mut self, other: Wrapping<Uint<LIMBS>>)
Performs the
&= operation. Read more§impl<const LIMBS: usize> BitOrAssign<&Wrapping<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> BitOrAssign<&Wrapping<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
§fn bitor_assign(&mut self, other: &Wrapping<Uint<LIMBS>>)
fn bitor_assign(&mut self, other: &Wrapping<Uint<LIMBS>>)
Performs the
|= operation. Read more§impl<const LIMBS: usize> BitOrAssign for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> BitOrAssign for Wrapping<Uint<LIMBS>>
§fn bitor_assign(&mut self, other: Wrapping<Uint<LIMBS>>)
fn bitor_assign(&mut self, other: Wrapping<Uint<LIMBS>>)
Performs the
|= operation. Read more§impl<const LIMBS: usize> BitXorAssign<&Wrapping<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> BitXorAssign<&Wrapping<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
§fn bitxor_assign(&mut self, other: &Wrapping<Uint<LIMBS>>)
fn bitxor_assign(&mut self, other: &Wrapping<Uint<LIMBS>>)
Performs the
^= operation. Read more§impl<const LIMBS: usize> BitXorAssign for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> BitXorAssign for Wrapping<Uint<LIMBS>>
§fn bitxor_assign(&mut self, other: Wrapping<Uint<LIMBS>>)
fn bitxor_assign(&mut self, other: Wrapping<Uint<LIMBS>>)
Performs the
^= operation. Read more§impl<T> ConditionallySelectable for Wrapping<T>where
T: ConditionallySelectable,
impl<T> ConditionallySelectable for Wrapping<T>where
T: ConditionallySelectable,
Source§fn conditional_assign(&mut self, other: &Self, choice: Choice)
fn conditional_assign(&mut self, other: &Self, choice: Choice)
Source§fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
Conditionally swap
self and other if choice == 1; otherwise,
reassign both unto themselves. Read more§impl<T> ConstantTimeEq for Wrapping<T>where
T: ConstantTimeEq,
impl<T> ConstantTimeEq for Wrapping<T>where
T: ConstantTimeEq,
§impl<const LIMBS: usize> DivAssign<&NonZero<Limb>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> DivAssign<&NonZero<Limb>> for Wrapping<Uint<LIMBS>>
§fn div_assign(&mut self, rhs: &NonZero<Limb>)
fn div_assign(&mut self, rhs: &NonZero<Limb>)
Performs the
/= operation. Read more§impl<const LIMBS: usize> DivAssign<&NonZero<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> DivAssign<&NonZero<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
§fn div_assign(&mut self, rhs: &NonZero<Uint<LIMBS>>)
fn div_assign(&mut self, rhs: &NonZero<Uint<LIMBS>>)
Performs the
/= operation. Read more§impl<const LIMBS: usize> DivAssign<NonZero<Limb>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> DivAssign<NonZero<Limb>> for Wrapping<Uint<LIMBS>>
§fn div_assign(&mut self, rhs: NonZero<Limb>)
fn div_assign(&mut self, rhs: NonZero<Limb>)
Performs the
/= operation. Read more§impl<const LIMBS: usize> DivAssign<NonZero<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> DivAssign<NonZero<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
§fn div_assign(&mut self, rhs: NonZero<Uint<LIMBS>>)
fn div_assign(&mut self, rhs: NonZero<Uint<LIMBS>>)
Performs the
/= operation. Read more§impl<const LIMBS: usize, const HLIMBS: usize> Mul<&Wrapping<Uint<HLIMBS>>> for &Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize, const HLIMBS: usize> Mul<&Wrapping<Uint<HLIMBS>>> for &Wrapping<Uint<LIMBS>>
§impl<const LIMBS: usize, const HLIMBS: usize> Mul<&Wrapping<Uint<HLIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize, const HLIMBS: usize> Mul<&Wrapping<Uint<HLIMBS>>> for Wrapping<Uint<LIMBS>>
§impl<const LIMBS: usize, const HLIMBS: usize> Mul<Wrapping<Uint<HLIMBS>>> for &Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize, const HLIMBS: usize> Mul<Wrapping<Uint<HLIMBS>>> for &Wrapping<Uint<LIMBS>>
§impl<const LIMBS: usize, const HLIMBS: usize> Mul<Wrapping<Uint<HLIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize, const HLIMBS: usize> Mul<Wrapping<Uint<HLIMBS>>> for Wrapping<Uint<LIMBS>>
§impl MulAssign<&Wrapping<Limb>> for Wrapping<Limb>
impl MulAssign<&Wrapping<Limb>> for Wrapping<Limb>
§fn mul_assign(&mut self, other: &Wrapping<Limb>)
fn mul_assign(&mut self, other: &Wrapping<Limb>)
Performs the
*= operation. Read more§impl<const LIMBS: usize, const HLIMBS: usize> MulAssign<&Wrapping<Uint<HLIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize, const HLIMBS: usize> MulAssign<&Wrapping<Uint<HLIMBS>>> for Wrapping<Uint<LIMBS>>
§fn mul_assign(&mut self, other: &Wrapping<Uint<HLIMBS>>)
fn mul_assign(&mut self, other: &Wrapping<Uint<HLIMBS>>)
Performs the
*= operation. Read more§impl<const LIMBS: usize, const HLIMBS: usize> MulAssign<Wrapping<Uint<HLIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize, const HLIMBS: usize> MulAssign<Wrapping<Uint<HLIMBS>>> for Wrapping<Uint<LIMBS>>
§fn mul_assign(&mut self, other: Wrapping<Uint<HLIMBS>>)
fn mul_assign(&mut self, other: Wrapping<Uint<HLIMBS>>)
Performs the
*= operation. Read more§impl MulAssign for Wrapping<Limb>
impl MulAssign for Wrapping<Limb>
§fn mul_assign(&mut self, other: Wrapping<Limb>)
fn mul_assign(&mut self, other: Wrapping<Limb>)
Performs the
*= operation. Read more§impl<T> Ord for Wrapping<T>where
T: Ord,
impl<T> Ord for Wrapping<T>where
T: Ord,
§impl<T> PartialOrd for Wrapping<T>where
T: PartialOrd,
impl<T> PartialOrd for Wrapping<T>where
T: PartialOrd,
§impl<T> Random for Wrapping<T>where
T: Random,
Available on crate feature rand_core only.
impl<T> Random for Wrapping<T>where
T: Random,
Available on crate feature
rand_core only.§fn random(rng: &mut impl CryptoRngCore) -> Wrapping<T>
fn random(rng: &mut impl CryptoRngCore) -> Wrapping<T>
Generate a cryptographically secure random value.
§impl<const LIMBS: usize> RemAssign<&NonZero<Limb>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> RemAssign<&NonZero<Limb>> for Wrapping<Uint<LIMBS>>
§fn rem_assign(&mut self, rhs: &NonZero<Limb>)
fn rem_assign(&mut self, rhs: &NonZero<Limb>)
Performs the
%= operation. Read more§impl<const LIMBS: usize> RemAssign<&NonZero<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> RemAssign<&NonZero<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
§fn rem_assign(&mut self, rhs: &NonZero<Uint<LIMBS>>)
fn rem_assign(&mut self, rhs: &NonZero<Uint<LIMBS>>)
Performs the
%= operation. Read more§impl<const LIMBS: usize> RemAssign<NonZero<Limb>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> RemAssign<NonZero<Limb>> for Wrapping<Uint<LIMBS>>
§fn rem_assign(&mut self, rhs: NonZero<Limb>)
fn rem_assign(&mut self, rhs: NonZero<Limb>)
Performs the
%= operation. Read more§impl<const LIMBS: usize> RemAssign<NonZero<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> RemAssign<NonZero<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
§fn rem_assign(&mut self, rhs: NonZero<Uint<LIMBS>>)
fn rem_assign(&mut self, rhs: NonZero<Uint<LIMBS>>)
Performs the
%= operation. Read more§impl SubAssign<&Wrapping<Limb>> for Wrapping<Limb>
impl SubAssign<&Wrapping<Limb>> for Wrapping<Limb>
§fn sub_assign(&mut self, other: &Wrapping<Limb>)
fn sub_assign(&mut self, other: &Wrapping<Limb>)
Performs the
-= operation. Read more§impl<const LIMBS: usize> SubAssign<&Wrapping<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> SubAssign<&Wrapping<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
§fn sub_assign(&mut self, other: &Wrapping<Uint<LIMBS>>)
fn sub_assign(&mut self, other: &Wrapping<Uint<LIMBS>>)
Performs the
-= operation. Read more§impl SubAssign for Wrapping<Limb>
impl SubAssign for Wrapping<Limb>
§fn sub_assign(&mut self, other: Wrapping<Limb>)
fn sub_assign(&mut self, other: Wrapping<Limb>)
Performs the
-= operation. Read more§impl<const LIMBS: usize> SubAssign for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> SubAssign for Wrapping<Uint<LIMBS>>
§fn sub_assign(&mut self, other: Wrapping<Uint<LIMBS>>)
fn sub_assign(&mut self, other: Wrapping<Uint<LIMBS>>)
Performs the
-= operation. Read moreimpl<T> Copy for Wrapping<T>where
T: Copy,
impl<T> Eq for Wrapping<T>where
T: Eq,
impl<T> StructuralPartialEq for Wrapping<T>
Auto Trait Implementations§
impl<T> Freeze for Wrapping<T>where
T: Freeze,
impl<T> RefUnwindSafe for Wrapping<T>where
T: RefUnwindSafe,
impl<T> Send for Wrapping<T>where
T: Send,
impl<T> Sync for Wrapping<T>where
T: Sync,
impl<T> Unpin for Wrapping<T>where
T: Unpin,
impl<T> UnwindSafe for Wrapping<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more