Type Alias SpanSecondsOrLower

Source
pub(crate) type SpanSecondsOrLower = ri64<{ _ }, { _ }>;
Expand description

The range of allowable seconds and lower in a span, in units of seconds.

This corresponds to when the min/max of seconds, milliseconds, microseconds and nanoseconds are added together in a span. This is useful for describing the limit on the total number of possible seconds when all of these units are combined. This is necessary as part of printing/parsing spans because the ISO 8601 duration format doesn’t support individual millisecond, microsecond and nanosecond components. So they all need to be smushed into seconds and a possible fractional part.

Aliased Type§

pub(crate) struct SpanSecondsOrLower {
    pub(crate) val: i64,
    pub(crate) min: i64,
    pub(crate) max: i64,
}

Fields§

§val: i64

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

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

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