pub trait Ring:
Copy
+ Sized
+ PartialEq
+ PartialOrd
+ Debug {
const ZERO: Self;
const ONE: Self;
const TWO: Self;
Show 20 methods
// Required methods
fn add(self, other: Self) -> Self;
fn add_assign(&mut self, other: Self);
fn mul(self, other: Self) -> Self;
fn mul_assign(&mut self, other: Self);
fn sub(self, other: Self) -> Self;
fn sub_assign(&mut self, other: Self);
fn div(self, other: Self) -> Self;
fn div_assign(&mut self, other: Self);
fn pow(self, other: u32) -> Self;
fn neg(self) -> Self;
fn abs(self) -> Self;
fn sign(self) -> Self;
fn cmp(&self, other: &Self) -> Ordering;
fn is_zero(self) -> bool;
fn is_nan(self) -> bool;
fn is_finite(self) -> bool;
fn rem_euclid(self, other: Self) -> Self;
// Provided methods
fn clamp(self, min: Self, max: Self) -> Self { ... }
fn min(self, other: Self) -> Self { ... }
fn max(self, other: Self) -> Self { ... }
}Required Associated Constants§
Required Methods§
fn add(self, other: Self) -> Self
fn add_assign(&mut self, other: Self)
fn mul(self, other: Self) -> Self
fn mul_assign(&mut self, other: Self)
fn sub(self, other: Self) -> Self
fn sub_assign(&mut self, other: Self)
fn div(self, other: Self) -> Self
fn div_assign(&mut self, other: Self)
fn pow(self, other: u32) -> Self
fn neg(self) -> Self
fn abs(self) -> Self
fn sign(self) -> Self
fn cmp(&self, other: &Self) -> Ordering
fn is_zero(self) -> bool
fn is_nan(self) -> bool
fn is_finite(self) -> bool
fn rem_euclid(self, other: Self) -> Self
Provided Methods§
fn clamp(self, min: Self, max: Self) -> Self
fn min(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".