Skip to main content

Ring

Trait Ring 

Source
pub trait Ring:
    AdditiveGroup
    + MultiplicativeMonoid
    + MulAdd<Self, Self, Output = Self>
    + MulAddAssign<Self, Self>
    + Debug {
    // Provided methods
    fn two() -> Self { ... }
    fn three() -> Self { ... }
    fn four() -> Self { ... }
    fn five() -> Self { ... }
    fn six() -> Self { ... }
    fn seven() -> Self { ... }
    fn eight() -> Self { ... }
    fn nine() -> Self { ... }
    fn ten() -> Self { ... }
}
Expand description

Interface for a ring as a combination of an additive group and a distributive multiplication operation.

This is basically the base “scalar” trait (a Module is defined over a Ring). Here we also add the Debug trait as a constraint because basically all scalars should implement Debug, and this avoids us needing to explicitly give a Debug constraint when using functions or macros like assert_eq that require it.

Provided Methods§

Source

fn two() -> Self

Source

fn three() -> Self

Source

fn four() -> Self

Source

fn five() -> Self

Source

fn six() -> Self

Source

fn seven() -> Self

Source

fn eight() -> Self

Source

fn nine() -> Self

Source

fn ten() -> 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§

Source§

impl<T> Ring for T
where T: AdditiveGroup + MultiplicativeMonoid + MulAdd<Self, Self, Output = Self> + MulAddAssign<Self, Self> + Debug,