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: T
Trait Implementations§
source§impl<T: WrappingAdd> Add for Wrapping<T>
impl<T: WrappingAdd> Add for Wrapping<T>
source§impl AddAssign<&Wrapping<BoxedUint>> for Wrapping<BoxedUint>
Available on crate feature alloc
only.
impl AddAssign<&Wrapping<BoxedUint>> for Wrapping<BoxedUint>
Available on crate feature
alloc
only.source§impl AddAssign<&Wrapping<Limb>> for Wrapping<Limb>
impl AddAssign<&Wrapping<Limb>> for Wrapping<Limb>
source§fn add_assign(&mut self, other: &Self)
fn add_assign(&mut self, other: &Self)
Performs the
+=
operation. Read moresource§impl<const LIMBS: usize> AddAssign<&Wrapping<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> AddAssign<&Wrapping<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
source§fn add_assign(&mut self, other: &Self)
fn add_assign(&mut self, other: &Self)
Performs the
+=
operation. Read moresource§impl AddAssign for Wrapping<Limb>
impl AddAssign for Wrapping<Limb>
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+=
operation. Read moresource§impl<const LIMBS: usize> AddAssign for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> AddAssign for Wrapping<Uint<LIMBS>>
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+=
operation. Read moresource§impl BitAnd<&Wrapping<BoxedUint>> for &Wrapping<BoxedUint>
Available on crate feature alloc
only.
impl BitAnd<&Wrapping<BoxedUint>> for &Wrapping<BoxedUint>
Available on crate feature
alloc
only.source§impl BitAnd<&Wrapping<BoxedUint>> for Wrapping<BoxedUint>
Available on crate feature alloc
only.
impl BitAnd<&Wrapping<BoxedUint>> for Wrapping<BoxedUint>
Available on crate feature
alloc
only.source§impl BitAnd<Wrapping<BoxedUint>> for &Wrapping<BoxedUint>
Available on crate feature alloc
only.
impl BitAnd<Wrapping<BoxedUint>> for &Wrapping<BoxedUint>
Available on crate feature
alloc
only.source§impl BitAndAssign<&Wrapping<BoxedUint>> for Wrapping<BoxedUint>
Available on crate feature alloc
only.
impl BitAndAssign<&Wrapping<BoxedUint>> for Wrapping<BoxedUint>
Available on crate feature
alloc
only.source§fn bitand_assign(&mut self, other: &Self)
fn bitand_assign(&mut self, other: &Self)
Performs the
&=
operation. Read moresource§impl<const LIMBS: usize> BitAndAssign<&Wrapping<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> BitAndAssign<&Wrapping<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
source§fn bitand_assign(&mut self, other: &Self)
fn bitand_assign(&mut self, other: &Self)
Performs the
&=
operation. Read moresource§impl BitAndAssign for Wrapping<BoxedUint>
Available on crate feature alloc
only.
impl BitAndAssign for Wrapping<BoxedUint>
Available on crate feature
alloc
only.source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
Performs the
&=
operation. Read moresource§impl<const LIMBS: usize> BitAndAssign for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> BitAndAssign for Wrapping<Uint<LIMBS>>
source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
Performs the
&=
operation. Read moresource§impl BitOr<&Wrapping<BoxedUint>> for &Wrapping<BoxedUint>
Available on crate feature alloc
only.
impl BitOr<&Wrapping<BoxedUint>> for &Wrapping<BoxedUint>
Available on crate feature
alloc
only.source§impl BitOr<&Wrapping<BoxedUint>> for Wrapping<BoxedUint>
Available on crate feature alloc
only.
impl BitOr<&Wrapping<BoxedUint>> for Wrapping<BoxedUint>
Available on crate feature
alloc
only.source§impl BitOr<Wrapping<BoxedUint>> for &Wrapping<BoxedUint>
Available on crate feature alloc
only.
impl BitOr<Wrapping<BoxedUint>> for &Wrapping<BoxedUint>
Available on crate feature
alloc
only.source§impl BitOrAssign<&Wrapping<BoxedUint>> for Wrapping<BoxedUint>
Available on crate feature alloc
only.
impl BitOrAssign<&Wrapping<BoxedUint>> for Wrapping<BoxedUint>
Available on crate feature
alloc
only.source§fn bitor_assign(&mut self, other: &Self)
fn bitor_assign(&mut self, other: &Self)
Performs the
|=
operation. Read moresource§impl<const LIMBS: usize> BitOrAssign<&Wrapping<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> BitOrAssign<&Wrapping<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
source§fn bitor_assign(&mut self, other: &Self)
fn bitor_assign(&mut self, other: &Self)
Performs the
|=
operation. Read moresource§impl BitOrAssign for Wrapping<BoxedUint>
Available on crate feature alloc
only.
impl BitOrAssign for Wrapping<BoxedUint>
Available on crate feature
alloc
only.source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Performs the
|=
operation. Read moresource§impl<const LIMBS: usize> BitOrAssign for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> BitOrAssign for Wrapping<Uint<LIMBS>>
source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Performs the
|=
operation. Read moresource§impl BitXor<&Wrapping<BoxedUint>> for &Wrapping<BoxedUint>
Available on crate feature alloc
only.
impl BitXor<&Wrapping<BoxedUint>> for &Wrapping<BoxedUint>
Available on crate feature
alloc
only.source§impl BitXor<&Wrapping<BoxedUint>> for Wrapping<BoxedUint>
Available on crate feature alloc
only.
impl BitXor<&Wrapping<BoxedUint>> for Wrapping<BoxedUint>
Available on crate feature
alloc
only.source§impl BitXor<Wrapping<BoxedUint>> for &Wrapping<BoxedUint>
Available on crate feature alloc
only.
impl BitXor<Wrapping<BoxedUint>> for &Wrapping<BoxedUint>
Available on crate feature
alloc
only.source§impl BitXorAssign<&Wrapping<BoxedUint>> for Wrapping<BoxedUint>
Available on crate feature alloc
only.
impl BitXorAssign<&Wrapping<BoxedUint>> for Wrapping<BoxedUint>
Available on crate feature
alloc
only.source§fn bitxor_assign(&mut self, other: &Self)
fn bitxor_assign(&mut self, other: &Self)
Performs the
^=
operation. Read moresource§impl<const LIMBS: usize> BitXorAssign<&Wrapping<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> BitXorAssign<&Wrapping<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
source§fn bitxor_assign(&mut self, other: &Self)
fn bitxor_assign(&mut self, other: &Self)
Performs the
^=
operation. Read moresource§impl BitXorAssign for Wrapping<BoxedUint>
Available on crate feature alloc
only.
impl BitXorAssign for Wrapping<BoxedUint>
Available on crate feature
alloc
only.source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
Performs the
^=
operation. Read moresource§impl<const LIMBS: usize> BitXorAssign for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> BitXorAssign for Wrapping<Uint<LIMBS>>
source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
Performs the
^=
operation. Read moresource§impl<T: ConditionallySelectable> ConditionallySelectable for Wrapping<T>
impl<T: ConditionallySelectable> ConditionallySelectable for Wrapping<T>
source§fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
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 moresource§impl<T: ConstantTimeEq> ConstantTimeEq for Wrapping<T>
impl<T: ConstantTimeEq> ConstantTimeEq for Wrapping<T>
source§impl<'de, T: Deserialize<'de>> Deserialize<'de> for Wrapping<T>
Available on crate feature serde
only.
impl<'de, T: Deserialize<'de>> Deserialize<'de> for Wrapping<T>
Available on crate feature
serde
only.source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl DivAssign<&NonZero<BoxedUint>> for Wrapping<BoxedUint>
Available on crate feature alloc
only.
impl DivAssign<&NonZero<BoxedUint>> for Wrapping<BoxedUint>
Available on crate feature
alloc
only.source§impl DivAssign<NonZero<BoxedUint>> for Wrapping<BoxedUint>
Available on crate feature alloc
only.
impl DivAssign<NonZero<BoxedUint>> for Wrapping<BoxedUint>
Available on crate feature
alloc
only.source§impl<T: WrappingMul> Mul for Wrapping<T>
impl<T: WrappingMul> Mul for Wrapping<T>
source§impl MulAssign<&Wrapping<BoxedUint>> for Wrapping<BoxedUint>
Available on crate feature alloc
only.
impl MulAssign<&Wrapping<BoxedUint>> for Wrapping<BoxedUint>
Available on crate feature
alloc
only.source§impl MulAssign<&Wrapping<Limb>> for Wrapping<Limb>
impl MulAssign<&Wrapping<Limb>> for Wrapping<Limb>
source§fn mul_assign(&mut self, other: &Self)
fn mul_assign(&mut self, other: &Self)
Performs the
*=
operation. Read moresource§impl MulAssign for Wrapping<Limb>
impl MulAssign for Wrapping<Limb>
source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the
*=
operation. Read moresource§impl<T: WrappingNeg> Neg for &Wrapping<T>
impl<T: WrappingNeg> Neg for &Wrapping<T>
source§impl<T: WrappingNeg> Neg for Wrapping<T>
impl<T: WrappingNeg> Neg for Wrapping<T>
source§impl<T: Ord> Ord for Wrapping<T>
impl<T: Ord> Ord for Wrapping<T>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<T: PartialOrd> PartialOrd for Wrapping<T>
impl<T: PartialOrd> PartialOrd for Wrapping<T>
source§impl<T: Random> Random for Wrapping<T>
Available on crate feature rand_core
only.
impl<T: Random> Random for Wrapping<T>
Available on crate feature
rand_core
only.source§fn random(rng: &mut impl CryptoRngCore) -> Self
fn random(rng: &mut impl CryptoRngCore) -> Self
Generate a cryptographically secure random value.
source§impl<T: WrappingSub> Sub for Wrapping<T>
impl<T: WrappingSub> Sub for Wrapping<T>
source§impl SubAssign<&Wrapping<BoxedUint>> for Wrapping<BoxedUint>
Available on crate feature alloc
only.
impl SubAssign<&Wrapping<BoxedUint>> for Wrapping<BoxedUint>
Available on crate feature
alloc
only.source§impl SubAssign<&Wrapping<Limb>> for Wrapping<Limb>
impl SubAssign<&Wrapping<Limb>> for Wrapping<Limb>
source§fn sub_assign(&mut self, other: &Self)
fn sub_assign(&mut self, other: &Self)
Performs the
-=
operation. Read moresource§impl<const LIMBS: usize> SubAssign<&Wrapping<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> SubAssign<&Wrapping<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>
source§fn sub_assign(&mut self, other: &Self)
fn sub_assign(&mut self, other: &Self)
Performs the
-=
operation. Read moresource§impl SubAssign for Wrapping<Limb>
impl SubAssign for Wrapping<Limb>
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-=
operation. Read moresource§impl<const LIMBS: usize> SubAssign for Wrapping<Uint<LIMBS>>
impl<const LIMBS: usize> SubAssign for Wrapping<Uint<LIMBS>>
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-=
operation. Read moreimpl<T: Copy> Copy for Wrapping<T>
impl<T: Eq> Eq for Wrapping<T>
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)