Skip to main content

RingOps

Trait RingOps 

Source
pub trait RingOps<Rhs = Self, Output = Self>:
    Add<Rhs, Output = Output>
    + Sub<Rhs, Output = Output>
    + Mul<Rhs, Output = Output> { }
Expand description

Generic trait for types implementing the division-free basic numeric operations: addition, subtraction and multiplication.

This is the aggregation to bound on when the type may not expose division — e.g. constant-time integers, where division is inherently data-dependent. NumOps extends it with Div and Rem.

This is automatically implemented for types which implement the operators.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T, Rhs, Output> RingOps<Rhs, Output> for T
where T: Add<Rhs, Output = Output> + Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output>,