Trait typerat::NonNegative
source · pub trait NonNegative: Sealed { }
Expand description
Marker trait for non-negative numbers.
§Examples
use typerat::*;
fn is_nonnegative<T: NonNegative>() -> bool {
true
}
assert!(is_nonnegative::<Z0>());
assert!(is_nonnegative::<P1>());
assert!(is_nonnegative::<Q<Z0>>());
assert!(is_nonnegative::<Q<P1>>());
assert!(is_nonnegative::<Q<P2, P3>>());
ⓘ
assert!(is_nonnegative::<N1>());
ⓘ
assert!(is_nonnegative::<Q<N1>>());
ⓘ
assert!(is_nonnegative::<Q<N2, P3>>());