Type Alias Day

Source
pub(crate) type Day = ri8<1, 31>;
Expand description

The range of possible day values.

Obviously this range is not valid for every month. Therefore, code working with days needs to be careful to check that it is valid for whatever month is being used.

Aliased Type§

pub(crate) struct Day {
    pub(crate) val: i8,
    pub(crate) min: i8,
    pub(crate) max: i8,
}

Fields§

§val: i8

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: i8

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: i8

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.)