Skip to content

Commit 91ac5f5

Browse files
committed
wasip2: Implement SystemTime::{MIN, MAX}
See the wasip1 implementation, which is functionally equivalent.
1 parent 87c865a commit 91ac5f5

File tree

1 file changed

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

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ impl Instant {
3131
}
3232

3333
impl SystemTime {
34+
#[unstable(feature = "time_systemtime_limits", issue = "none")]
35+
pub const MAX: SystemTime = SystemTime(Duration::MAX);
36+
37+
#[unstable(feature = "time_systemtime_limits", issue = "none")]
38+
pub const MIN: SystemTime = SystemTime(Duration::ZERO);
39+
3440
pub fn now() -> SystemTime {
3541
let now = wasip2::clocks::wall_clock::now();
3642
SystemTime(Duration::new(now.seconds, now.nanoseconds))

0 commit comments

Comments
 (0)