pub trait Ring: Additive + Multiplicative {
// Required method
fn one() -> Self;
// Provided method
fn exp(&self, bits_le: &[u64]) -> Self { ... }
}Expand description
An instance of a mathematical Ring.
This combines Additive and Multiplicative, and introduces a
neutral element for multiplication, Ring::one.
§Properties
Implementations are expected to be commutative rings:
AdditiveandMultiplicativelaws both hold,Ring::onesatisfies1 * a = a,- multiplication satisfies
(a + b) * c = a * c + b * c, Ring::expsatisfiesa.exp(&[]) = 1,a.exp(&[1]) = a, anda.exp(m + n) = a.exp(m) * a.exp(n).
Required Methods§
Provided Methods§
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.