Closed
Description
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
- Implement the proposal: Add saturating methods for
Duration
#76114 - FCP
- Stabilization PR: Stabilize feature
duration_saturating_ops
#84090
Unresolved Questions
Do we want associated constants similar to the ones that already exist for integer types or associated methods? (ie:Duration::MIN
orDuration::min()
?ShouldDuration::MIN
be replaced byDuration::zero()
? They are currently equivalent but one can image a future whereDuration
is able to hold negative duration and thus makingMIN
different fromzero()
.
Metadata
Metadata
Assignees
Labels
Area: TimeCategory: An issue tracking the progress of sth. like the implementation of an RFCLibs issues that are tracked on the team's project board.Relevant to the library API team, which will review and decide on the PR/issue.This issue / PR is in PFCP or FCP with a disposition to merge it.The final comment period is finished for this PR / Issue.