Expand description
Drop-in integer operations, and a refinement-typed integer.
The safe_* functions are the total-function route to overflow: each returns
an Option, and crate::prove carries the proof that the None case is
exactly the overflow case.
Bounded is the type-level route: a value known at compile time to lie in
[MIN, MAX]. The constructors are the only way in, so the invariant cannot
be broken by construction, and crate::prove::bounded_sub_is_total proves
that Bounded::sub accepts exactly the in-range cases.
Structs§
- Bounded
- A value known at compile time to lie in
[MIN, MAX].