-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
WasiCtxBuilder
setters for the two clock types (#6669)
* Add WasiCtxBuilder setters for the two clock types Signed-off-by: Ryan Levick <ryan.levick@fermyon.com> * Move two clocks to dedicated fields in WasiCtx * Rename clock traits to Host prefix convention Signed-off-by: Ryan Levick <ryan.levick@fermyon.com> * Fix tests --------- Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
- Loading branch information
Showing
9 changed files
with
47 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,12 @@ | ||
pub mod host; | ||
use cap_std::time::Duration; | ||
|
||
pub trait WasiWallClock: Send + Sync { | ||
pub trait HostWallClock: Send + Sync { | ||
fn resolution(&self) -> Duration; | ||
fn now(&self) -> Duration; | ||
} | ||
|
||
pub trait WasiMonotonicClock: Send + Sync { | ||
pub trait HostMonotonicClock: Send + Sync { | ||
fn resolution(&self) -> u64; | ||
fn now(&self) -> u64; | ||
} | ||
|
||
pub struct WasiClocks { | ||
pub wall: Box<dyn WasiWallClock + Send + Sync>, | ||
pub monotonic: Box<dyn WasiMonotonicClock + Send + Sync>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters