-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Feature gate: #![feature(time_saturating_systemtime)]
This is a tracking issue for rust-lang/libs-team#718
This feature adds the following three methods to SystemTime:
SystemTime::saturating_addSystemTime::saturating_subSystemTime::saturating_duration_since
Public API
// std::time
impl SystemTime {
// ...
fn saturating_add(&self, rhs: Duration) -> Self {
self.checked_add(rhs).unwrap_or(SystemTime::MAX)
}
fn saturating_sub(&self, rhs: Duration) -> Self {
self.checked_sub(rhs).unwrap_or(SystemTime::MIN)
}
fn saturating_duration_since(&self, rhs: Self) -> Duration {
self.duration_since(rhs).unwrap_or(Duration::ZERO)
}
}Steps / History
(Remember to update the S-tracking-* label when checking boxes.)
- ACP: ACP: Add saturating artihmetic for
SystemTimelibs-team#718 - Implementation: time: Add saturating arithmetic for
SystemTime#151200 - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- None yet.
Footnotes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.