| ... | ... | @@ -1604,6 +1604,13 @@ pub fn cancelRequested(io: Io) bool { |
| 1604 | 1604 | |
| 1605 | 1605 | pub const SleepError = error{UnsupportedClock} || UnexpectedError || Cancelable; |
| 1606 | 1606 | |
| 1607 | pub fn sleep(io: Io, duration: Duration, clock: Clock) SleepError!void { |
| 1608 | return io.vtable.sleep(io.userdata, .{ .duration = .{ |
| 1609 | .raw = duration, |
| 1610 | .clock = clock, |
| 1611 | } }); |
| 1612 | } |
| 1613 | |
| 1607 | 1614 | /// Given a struct with each field a `*Future`, returns a union with the same |
| 1608 | 1615 | /// fields, each field type the future's result. |
| 1609 | 1616 | pub fn SelectUnion(S: type) type { |