pub(crate) type Year = ri16<-9999, 9999>;
Expand description
The range of years supported by jiff.
This is ultimately where some of the other ranges (like UnixSeconds
)
were determined from. That is, the range of years is the primary point at
which the space of supported time instants is derived from. If one wanted
to expand this range, you’d need to change it here and then compute the
corresponding min/max values for UnixSeconds
.
Aliased Type§
pub(crate) struct Year {
pub(crate) val: i16,
pub(crate) min: i16,
pub(crate) max: i16,
}
Fields§
§val: i16
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: i16
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: i16
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.)