Something like a num::Bounded
with MIN
& MAX
, maybe? Probably the most useful thing to see would be examples of code that could take advantage of such a trait, to answer questions like "what about num::BigUint
that has MIN
but not MAX
?".
BITS
is arguably weird in generic code, since one could say that NonZeroU8
should be 7.994353... bits.
Hmm, maybe there's a nice holistic piece here by having a trait like num::SaturatingFrom
(as discussed, IIRC, in https://github.com/rust-lang/rfcs/pull/2484) and a corresponding trait with MIN
& MAX
that says what the range into which it saturates is.