pub struct DefaultStatic<T, M: Get<T = T>>(/* private fields */);
Expand description
why default
?
because there exists other modular arithmetic implementations.
e.g. Montgomery Multiplication, or Burrett Reduction.
Trait Implementations§
Source§impl<T: Clone, M: Clone + Get<T = T>> Clone for DefaultStatic<T, M>
impl<T: Clone, M: Clone + Get<T = T>> Clone for DefaultStatic<T, M>
Source§fn clone(&self) -> DefaultStatic<T, M>
fn clone(&self) -> DefaultStatic<T, M>
Returns a copy 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<T: Default, M: Default + Get<T = T>> Default for DefaultStatic<T, M>
impl<T: Default, M: Default + Get<T = T>> Default for DefaultStatic<T, M>
Source§fn default() -> DefaultStatic<T, M>
fn default() -> DefaultStatic<T, M>
Returns the “default value” for a type. Read more
Source§impl<M: Get<T = u32>> ModularArithmetic for DefaultStatic<u32, M>
impl<M: Get<T = u32>> ModularArithmetic for DefaultStatic<u32, M>
type T = u32
fn modulus() -> Self::T
fn add(lhs: Self::T, rhs: Self::T) -> Self::T
fn neg(x: Self::T) -> Self::T
fn mul(lhs: Self::T, rhs: Self::T) -> Self::T
fn inv(x: u32) -> Self::T
fn sub(lhs: Self::T, rhs: Self::T) -> Self::T
fn div(lhs: Self::T, rhs: Self::T) -> Self::T
Source§impl<M: Get<T = u64>> ModularArithmetic for DefaultStatic<u64, M>
impl<M: Get<T = u64>> ModularArithmetic for DefaultStatic<u64, M>
type T = u64
fn modulus() -> Self::T
fn add(lhs: Self::T, rhs: Self::T) -> Self::T
fn neg(x: Self::T) -> Self::T
fn mul(lhs: Self::T, rhs: Self::T) -> Self::T
fn inv(x: u64) -> Self::T
fn sub(lhs: Self::T, rhs: Self::T) -> Self::T
fn div(lhs: Self::T, rhs: Self::T) -> Self::T
Source§impl<T: Ord, M: Ord + Get<T = T>> Ord for DefaultStatic<T, M>
impl<T: Ord, M: Ord + Get<T = T>> Ord for DefaultStatic<T, M>
Source§fn cmp(&self, other: &DefaultStatic<T, M>) -> Ordering
fn cmp(&self, other: &DefaultStatic<T, M>) -> 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<T: PartialOrd, M: PartialOrd + Get<T = T>> PartialOrd for DefaultStatic<T, M>
impl<T: PartialOrd, M: PartialOrd + Get<T = T>> PartialOrd for DefaultStatic<T, M>
impl<T: Copy, M: Copy + Get<T = T>> Copy for DefaultStatic<T, M>
impl<T: Eq, M: Eq + Get<T = T>> Eq for DefaultStatic<T, M>
impl<T, M: Get<T = T>> StructuralPartialEq for DefaultStatic<T, M>
Auto Trait Implementations§
impl<T, M> Freeze for DefaultStatic<T, M>
impl<T, M> RefUnwindSafe for DefaultStatic<T, M>where
T: RefUnwindSafe,
M: RefUnwindSafe,
impl<T, M> Send for DefaultStatic<T, M>
impl<T, M> Sync for DefaultStatic<T, M>
impl<T, M> Unpin for DefaultStatic<T, M>
impl<T, M> UnwindSafe for DefaultStatic<T, M>where
T: UnwindSafe,
M: 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