Trait Modular

Source
pub trait Modular<T: Copy + Debug + Default + Add + Sub + Mul + Rem>:
    Copy
    + Debug
    + From<T>
    + Add
    + Sub
    + Mul
    + Eq {
    const MOD: T;

    // Required method
    fn remainder(&self) -> T;
}
Expand description

The Modular trait is implemented by all modular-arithmetic-defining classes.

Required Associated Constants§

Source

const MOD: T

The modulus of this type.

Required Methods§

Source

fn remainder(&self) -> T

The remainder of the value divided by MOD.

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§