This is a tracking issue for Duration saturating operations.
The feature gate for the issue is #![feature(duration_saturating_ops)].
impl Duration {
pub const fn saturating_add(self, rhs: Duration) -> Duration {}
pub const fn saturating_sub(self, rhs: Duration) -> Duration {}
pub const fn saturating_mul(self, rhs: u32) -> Duration {}
}
Steps
Unresolved Questions
Do we want associated constants similar to the ones that already exist for integer types or associated methods? (ie: Duration::MIN or Duration::min()?
Should Duration::MIN be replaced by Duration::zero()? They are currently equivalent but one can image a future where Duration is able to hold negative duration and thus making MIN different from zero().
This is a tracking issue for
Durationsaturating operations.The feature gate for the issue is
#![feature(duration_saturating_ops)].Steps
Duration#76114duration_saturating_ops#84090Unresolved Questions
Do we want associated constants similar to the ones that already exist for integer types or associated methods? (ie:Duration::MINorDuration::min()?ShouldDuration::MINbe replaced byDuration::zero()? They are currently equivalent but one can image a future whereDurationis able to hold negative duration and thus makingMINdifferent fromzero().