pub trait NonZeroAble {
type NonZero: NonZero;
// Required methods
fn as_nonzero(self) -> Option<Self::NonZero>;
unsafe fn as_nonzero_unchecked(self) -> Self::NonZero;
}
Expand description
A trait identifying integral types that have a non-zeroable equivalent.
Required Associated Types§
Required Methods§
Sourcefn as_nonzero(self) -> Option<Self::NonZero>
fn as_nonzero(self) -> Option<Self::NonZero>
Sourceunsafe fn as_nonzero_unchecked(self) -> Self::NonZero
unsafe fn as_nonzero_unchecked(self) -> Self::NonZero
Converts the integer to its non-zero equivalent without checking for zeroness.
This corresponds to the new_unchecked
function on the
corresponding NonZero type.