pub trait ConstZero: Sized {
const ZERO: Self;
}Expand description
Defines an associated constant representing the additive identity element
for Self.
This is a pure constant-carrier: it requires only that Self has a
compile-time 0, not that it implements Zero (and hence not
Add). Keeping it decoupled lets capability-restricted
types — e.g. a constant-time integer with bit ops but no arithmetic — supply
the 0 constant that PrimBits needs without being
forced to implement addition. Numeric types still implement both.
Required Associated Constants§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".