A wrapper around a numeric type, containing a valid value,
that will perform overflow checks on arithmetic operations.
Any arithmetic operation (like Add, Sub…) will be performed using checked
arithmetic and return a Unchecked type which will track overflow state. Additional
chaining additional arithmetic operations is possible witoutchecking overflow in intermediate steps.
Only when the final result is to be used, it’s neccessary to call Unchecked::check()
to convert back to Checked value.
T is the inner type (u8, i16, etc.) wrapped by this type.
D is a marker controlling automatic conversion to inner type. It defaults to WithDeref
which results in semi-implicit conversion to T available (like Deref). For values where handling
overflow is particularily important and opting out of it could have serious consequences,
WithoutDeref can be used, which will require calling
an explicit conversion function to convert to the inner type.