Trait typerat::NonZero

source ·
pub trait NonZero: Sealed { }
Expand description

Marker trait for non-zero numbers.

§Examples

use typerat::*;

fn is_nonzero<T: NonZero>() -> bool {
    true
}

assert!(is_nonzero::<P1>());
assert!(is_nonzero::<N1>());
assert!(is_nonzero::<Q<P1>>());
assert!(is_nonzero::<Q<N1>>());
assert!(is_nonzero::<Q<P2, P3>>());
assert!(is_nonzero::<Q<N2, P3>>());
assert!(is_nonzero::<Z0>());
assert!(is_nonzero::<Q<Z0>>());

Implementations on Foreign Types§

source§

impl<U> NonZero for NInt<U>
where U: NonZeroUnsigned,

source§

impl<U> NonZero for PInt<U>
where U: NonZeroUnsigned,

Implementors§

source§

impl<N, D> NonZero for Q<N, D>
where N: Numerator<D> + NonZero, D: Denominator,