Type Alias NoUnits128

Source
pub(crate) type NoUnits128 = ri128<{ i128::MIN }, { i128::MAX }>;
Expand description

A type alias for a ranged 128-bit integer with no units.

This is like NoUnits, but useful in contexts where one wants to limit values to what can be represented by an i128.

Aliased Type§

pub(crate) struct NoUnits128 {
    pub(crate) val: i128,
    pub(crate) min: i128,
    pub(crate) max: i128,
}

Fields§

§val: i128

The actual value of the integer.

Callers should not access this directly. There are some very rare cases where algorithms are too difficult to express on ranged integers, and it’s useful to be able to reach inside and access the raw value directly. (For example, the conversions between Unix epoch day and Gregorian date.)

§min: i128

The minimum possible value computed so far.

This value is only present when debug_assertions are enabled. In that case, it is used to ensure the minimum possible value when the integer is actually observed (or converted) is still within the legal range.

Callers should not access this directly. There are some very rare cases where algorithms are too difficult to express on ranged integers, and it’s useful to be able to reach inside and access the raw value directly. (For example, the conversions between Unix epoch day and Gregorian date.)

§max: i128

The maximum possible value computed so far.

This value is only present when debug_assertions are enabled. In that case, it is used to ensure the maximum possible value when the integer is actually observed (or converted) is still within the legal range.

Callers should not access this directly. There are some very rare cases where algorithms are too difficult to express on ranged integers, and it’s useful to be able to reach inside and access the raw value directly. (For example, the conversions between Unix epoch day and Gregorian date.)