pub trait One: Sized {
const ONE: Self;
// Provided methods
fn one() -> Self
where Self: Sized { ... }
fn set_one(&mut self) -> &mut Self { ... }
fn is_one(&self) -> bool
where Self: PartialEq { ... }
fn is_non_one(&self) -> bool
where Self: PartialEq { ... }
}Expand description
Define the 1 representation : The neutral element of the multiplication such that x * X::ONE = x
Required Associated Constants§
Provided Methods§
fn one() -> Selfwhere
Self: Sized,
fn set_one(&mut self) -> &mut Self
fn is_one(&self) -> boolwhere
Self: PartialEq,
fn is_non_one(&self) -> boolwhere
Self: PartialEq,
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.