Skip to main content

ModIntBase

Trait ModIntBase 

Source
pub trait ModIntBase:
    Copy
    + Eq
    + Hash
    + Add<Output = Self>
    + Sub<Output = Self>
    + Mul<Output = Self>
    + Div<Output = Self>
    + Neg
    + AddAssign
    + SubAssign
    + MulAssign
    + DivAssign {
    // Required methods
    fn modulus() -> u32;
    fn get(self) -> u32;
    unsafe fn new_unchecked(n: u32) -> Self;

    // Provided methods
    fn new(n: impl RemEuclidU32) -> Self { ... }
    fn recip(self) -> Self { ... }
    fn checked_recip(self) -> Option<Self> { ... }
    fn pow(self, iexp: u64) -> Self { ... }
}

Required Methods§

Source

fn modulus() -> u32

Source

fn get(self) -> u32

Source

unsafe fn new_unchecked(n: u32) -> Self

Provided Methods§

Source

fn new(n: impl RemEuclidU32) -> Self

Source

fn recip(self) -> Self

Source

fn checked_recip(self) -> Option<Self>

Source

fn pow(self, iexp: u64) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§