pub trait NonZero {
// Required method
fn is_not_zero(&self) -> bool;
}
Expand description
§Nonzero values
In contexts where this trait is required, implementors should not have value zero.
This trait is used for debug asserts. Values in sparse data structures should never be zero, and
requiring that they implement num_traits::Zero
prohibits writing number types that can’t
represent the value 0.
The num_traits::Zero
trait is for types that can be zero, this trait is for types that can be
a value other than zero. They may or may not be able to represent zero.
Required Methods§
sourcefn is_not_zero(&self) -> bool
fn is_not_zero(&self) -> bool
Whether the value is not equal to zero.
Should always be true
in the context in which it is called.