Skip to content

Commit 87c865a

Browse files
committed
pal/wasip1: Implement SystemTime::{MIN, MAX}
This commit implements `SystemTime::MIN` and `SystemTime::MAX` for wasip1. Similar to sgx, a `Duration` is used to store the time, thereby depending on those limits.
1 parent 14600f6 commit 87c865a

File tree

1 file changed

+6
-0
lines changed
  • library/std/src/sys/pal/wasip1

1 file changed

+6
-0
lines changed

library/std/src/sys/pal/wasip1/time.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ impl Instant {
3939
}
4040

4141
impl SystemTime {
42+
#[unstable(feature = "time_systemtime_limits", issue = "none")]
43+
pub const MAX: SystemTime = SystemTime(Duration::MAX);
44+
45+
#[unstable(feature = "time_systemtime_limits", issue = "none")]
46+
pub const MIN: SystemTime = SystemTime(Duration::ZERO);
47+
4248
pub fn now() -> SystemTime {
4349
SystemTime(current_time(wasi::CLOCKID_REALTIME))
4450
}

0 commit comments

Comments
 (0)