numaxiom 0.0.2

Lightweight numeric marker traits for ranges/signs plus constants and ops; std by default, no_std optional.
Documentation
1
2
3
4
5
6
7
8
9
10
11
/// Marker trait for types that guarantee values are greater than or equal to zero.
/// Implementers must ensure all inhabited values are `>= 0`.
pub trait NonNegative {}

macro_rules! impl_non_negative {
    ($($ty:ty),+ $(,)?) => {
        $(impl NonNegative for $ty {})+
    };
}

impl_non_negative!(u8, u16, u32, u64, u128, usize);