pub struct ValidPrime {
p: u32,
}Fields§
§p: u32Implementations§
Source§impl ValidPrime
impl ValidPrime
Trait Implementations§
Source§impl Add<ValidPrime> for u32
impl Add<ValidPrime> for u32
Source§impl Add<u32> for ValidPrime
impl Add<u32> for ValidPrime
Source§impl Add for ValidPrime
impl Add for ValidPrime
Source§impl AddAssign<ValidPrime> for u32
impl AddAssign<ValidPrime> for u32
Source§fn add_assign(&mut self, other: ValidPrime)
fn add_assign(&mut self, other: ValidPrime)
Performs the
+= operation. Read moreSource§impl Arbitrary for ValidPrime
Available on crate feature proptest only.
impl Arbitrary for ValidPrime
Available on crate feature
proptest only.Source§fn arbitrary_with(max: Self::Parameters) -> Self::Strategy
fn arbitrary_with(max: Self::Parameters) -> Self::Strategy
An arbitrary ValidPrime in the range 2..(1 << 24), plus the largest prime that we
support. If max is specified, the primes are restricted to be less than max.
Source§type Parameters = Option<NonZero<u32>>
type Parameters = Option<NonZero<u32>>
The type of parameters that
arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default.Source§type Strategy = Select<ValidPrime>
type Strategy = Select<ValidPrime>
The type of
Strategy used to generate values of type Self.Source§impl Clone for ValidPrime
impl Clone for ValidPrime
Source§fn clone(&self) -> ValidPrime
fn clone(&self) -> ValidPrime
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ValidPrime
impl Debug for ValidPrime
Source§impl<'de> Deserialize<'de> for ValidPrime
impl<'de> Deserialize<'de> for ValidPrime
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 Display for ValidPrime
impl Display for ValidPrime
Source§impl Div<ValidPrime> for u32
impl Div<ValidPrime> for u32
Source§impl Div<u32> for ValidPrime
impl Div<u32> for ValidPrime
Source§impl Div for ValidPrime
impl Div for ValidPrime
Source§impl DivAssign<ValidPrime> for u32
impl DivAssign<ValidPrime> for u32
Source§fn div_assign(&mut self, other: ValidPrime)
fn div_assign(&mut self, other: ValidPrime)
Performs the
/= operation. Read moreSource§impl From<ValidPrime> for u32
impl From<ValidPrime> for u32
Source§fn from(value: ValidPrime) -> u32
fn from(value: ValidPrime) -> u32
Converts to this type from the input type.
Source§impl FromStr for ValidPrime
impl FromStr for ValidPrime
Source§impl Hash for ValidPrime
impl Hash for ValidPrime
Source§impl Mul<ValidPrime> for u32
impl Mul<ValidPrime> for u32
Source§impl Mul<u32> for ValidPrime
impl Mul<u32> for ValidPrime
Source§impl Mul for ValidPrime
impl Mul for ValidPrime
Source§impl MulAssign<ValidPrime> for u32
impl MulAssign<ValidPrime> for u32
Source§fn mul_assign(&mut self, other: ValidPrime)
fn mul_assign(&mut self, other: ValidPrime)
Performs the
*= operation. Read moreSource§impl PartialEq<u32> for ValidPrime
impl PartialEq<u32> for ValidPrime
Source§impl PartialEq for ValidPrime
impl PartialEq for ValidPrime
Source§impl PartialOrd<u32> for ValidPrime
impl PartialOrd<u32> for ValidPrime
Source§impl Prime for ValidPrime
impl Prime for ValidPrime
fn as_i32(self) -> i32
fn to_dyn(self) -> Self
fn as_u32(self) -> u32
fn as_usize(self) -> usize
Source§fn product(self, n1: u32, n2: u32) -> u32
fn product(self, n1: u32, n2: u32) -> u32
Computes the product mod p. This takes care of overflow.
fn inverse(self, k: u32) -> u32
fn pow(self, exp: u32) -> u32
fn pow_mod(self, b: u32, e: u32) -> u32
Source§impl Rem<ValidPrime> for u32
impl Rem<ValidPrime> for u32
Source§impl Rem<u32> for ValidPrime
impl Rem<u32> for ValidPrime
Source§impl Rem for ValidPrime
impl Rem for ValidPrime
Source§impl RemAssign<ValidPrime> for u32
impl RemAssign<ValidPrime> for u32
Source§fn rem_assign(&mut self, other: ValidPrime)
fn rem_assign(&mut self, other: ValidPrime)
Performs the
%= operation. Read moreSource§impl Serialize for ValidPrime
impl Serialize for ValidPrime
Source§impl Shl<ValidPrime> for u32
impl Shl<ValidPrime> for u32
Source§impl Shl<u32> for ValidPrime
impl Shl<u32> for ValidPrime
Source§impl Shl for ValidPrime
impl Shl for ValidPrime
Source§impl ShlAssign<ValidPrime> for u32
impl ShlAssign<ValidPrime> for u32
Source§fn shl_assign(&mut self, other: ValidPrime)
fn shl_assign(&mut self, other: ValidPrime)
Performs the
<<= operation. Read moreSource§impl Shr<ValidPrime> for u32
impl Shr<ValidPrime> for u32
Source§impl Shr<u32> for ValidPrime
impl Shr<u32> for ValidPrime
Source§impl Shr for ValidPrime
impl Shr for ValidPrime
Source§impl ShrAssign<ValidPrime> for u32
impl ShrAssign<ValidPrime> for u32
Source§fn shr_assign(&mut self, other: ValidPrime)
fn shr_assign(&mut self, other: ValidPrime)
Performs the
>>= operation. Read moreSource§impl Sub<ValidPrime> for u32
impl Sub<ValidPrime> for u32
Source§impl Sub<u32> for ValidPrime
impl Sub<u32> for ValidPrime
Source§impl Sub for ValidPrime
impl Sub for ValidPrime
Source§impl SubAssign<ValidPrime> for u32
impl SubAssign<ValidPrime> for u32
Source§fn sub_assign(&mut self, other: ValidPrime)
fn sub_assign(&mut self, other: ValidPrime)
Performs the
-= operation. Read moreSource§impl TryFrom<u32> for ValidPrime
impl TryFrom<u32> for ValidPrime
Source§type Error = PrimeError
type Error = PrimeError
The type returned in the event of a conversion error.
impl Copy for ValidPrime
impl Eq for ValidPrime
impl MaybeArbitrary<Option<NonZero<u32>>> for ValidPrime
impl StructuralPartialEq for ValidPrime
Auto Trait Implementations§
impl Freeze for ValidPrime
impl RefUnwindSafe for ValidPrime
impl Send for ValidPrime
impl Sync for ValidPrime
impl Unpin for ValidPrime
impl UnwindSafe for ValidPrime
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