pub trait Zero: Sized {
const ZERO: Self;
// Provided methods
fn zero() -> Self { ... }
fn set_zero(&mut self) -> &mut Self { ... }
fn is_zero(&self) -> bool
where Self: PartialEq { ... }
fn is_non_zero(&self) -> bool
where Self: PartialEq { ... }
}Expand description
Define the 0 representation : The absorbing element of the multiplication such that x * X::ZERO = X::ZERO
Required Associated Constants§
Provided Methods§
fn zero() -> Self
fn set_zero(&mut self) -> &mut Self
fn is_zero(&self) -> boolwhere
Self: PartialEq,
fn is_non_zero(&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.