Module uint

Module uint 

Source
Expand description

Defines the UnsignedPrimInt trait and its generic operations.

These are module functions rather than trait functions to avoid polluting the primitive integer namespaces.

Structs§

DebugDesc
The description of an unsigned integer returned by debug_desc.

Traits§

UnsignedPrimInt
An unsigned primitive integer.

Functions§

checked_add
Add the specified value to the integer, returning None if overflow occurs.
checked_cast
Cast from one UnsignedPrimInt into another, returning None if there is overflow.
checked_sub
Subtract the specified value from the integer, returning None if overflow occurs.
debug_desc
Attempt to describe the specified UnsignedPrimInt in a format suitable for debugging or panic messages.
from_usize_checked
Convert a primitive integer to a usize, returning None if overflow occurs.
from_usize_wrapping
Convert a primitive integer to a usize, wrapping around if overflow occurs.
max_value
Determine the maximum value of the specified UnsignedPrimInt.
one
Determine the one value of the specified UnsignedPrimInt.
to_usize_checked
Convert a primitive integer to a usize, returning None if overflow occurs.
to_usize_wrapping
Convert a primitive integer to a usize, wrapping around on overflow.
zero
Determine the zero value of the specified UnsignedPrimInt.