pub(crate) trait Integer: Sized {
const MAX_NUM_DIGITS: u8;
const ZERO: Self;
// Required methods
fn push_digit(self, digit: u8) -> Self;
fn checked_push_digit(self, digit: u8) -> Option<Self>;
}Available on crate feature
parsing only.Expand description
Marker trait for integer types.
Required Associated Constants§
Sourceconst MAX_NUM_DIGITS: u8
const MAX_NUM_DIGITS: u8
The maximum number of digits that this type can have.
Required Methods§
Sourcefn push_digit(self, digit: u8) -> Self
fn push_digit(self, digit: u8) -> Self
Push a digit onto the end of this integer, assuming no overflow.
This is equivalent to self * 10 + digit.
Sourcefn checked_push_digit(self, digit: u8) -> Option<Self>
fn checked_push_digit(self, digit: u8) -> Option<Self>
Push a digit onto the end of this integer, returning None on overflow.
This is equivalent to self.checked_mul(10)?.checked_add(digit).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.