pub struct Z32FastMul<const P: u32> { /* private fields */ }Expand description
Z32 variant for fast repeated multiplication
Use this variant to speed up repeated multiplication by the same value:
const P: u32 = 10007;
let mut numbers = Vec::from_iter((1..1000).map(Z32::<P>::from));
let factor: Z32FastMul<P> = 12.into();
for number in &mut numbers {
// same as `number *= Z32::from(12)`, but faster
*number *= &factor;
}Trait Implementations§
Source§impl<const P: u32> Clone for Z32FastMul<P>
impl<const P: u32> Clone for Z32FastMul<P>
Source§fn clone(&self) -> Z32FastMul<P>
fn clone(&self) -> Z32FastMul<P>
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<const P: u32> Debug for Z32FastMul<P>
impl<const P: u32> Debug for Z32FastMul<P>
Source§impl<const P: u32> Default for Z32FastMul<P>
impl<const P: u32> Default for Z32FastMul<P>
Source§fn default() -> Z32FastMul<P>
fn default() -> Z32FastMul<P>
Returns the “default value” for a type. Read more
Source§impl<const P: u32> From<Z32FastMul<P>> for Z32<P>
impl<const P: u32> From<Z32FastMul<P>> for Z32<P>
Source§fn from(z: Z32FastMul<P>) -> Self
fn from(z: Z32FastMul<P>) -> Self
Converts to this type from the input type.
Source§impl<const P: u32> Hash for Z32FastMul<P>
impl<const P: u32> Hash for Z32FastMul<P>
Source§impl<const P: u32> MulAssign<&Z32FastMul<P>> for Z32<P>
impl<const P: u32> MulAssign<&Z32FastMul<P>> for Z32<P>
Source§fn mul_assign(&mut self, rhs: &Z32FastMul<P>)
fn mul_assign(&mut self, rhs: &Z32FastMul<P>)
Performs the
*= operation. Read moreSource§impl<const P: u32> MulAssign<Z32FastMul<P>> for Z32<P>
impl<const P: u32> MulAssign<Z32FastMul<P>> for Z32<P>
Source§fn mul_assign(&mut self, rhs: Z32FastMul<P>)
fn mul_assign(&mut self, rhs: Z32FastMul<P>)
Performs the
*= operation. Read moreSource§impl<const P: u32> Ord for Z32FastMul<P>
impl<const P: u32> Ord for Z32FastMul<P>
Source§fn cmp(&self, other: &Z32FastMul<P>) -> Ordering
fn cmp(&self, other: &Z32FastMul<P>) -> Ordering
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<const P: u32> PartialEq for Z32FastMul<P>
impl<const P: u32> PartialEq for Z32FastMul<P>
Source§impl<const P: u32> PartialOrd for Z32FastMul<P>
impl<const P: u32> PartialOrd for Z32FastMul<P>
impl<const P: u32> Copy for Z32FastMul<P>
impl<const P: u32> Eq for Z32FastMul<P>
impl<const P: u32> StructuralPartialEq for Z32FastMul<P>
Auto Trait Implementations§
impl<const P: u32> Freeze for Z32FastMul<P>
impl<const P: u32> RefUnwindSafe for Z32FastMul<P>
impl<const P: u32> Send for Z32FastMul<P>
impl<const P: u32> Sync for Z32FastMul<P>
impl<const P: u32> Unpin for Z32FastMul<P>
impl<const P: u32> UnwindSafe for Z32FastMul<P>
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