Sha256: 54c8255af52a5806486e7b7e8addd2341836d025c3f8e8cd6d9373447319c33b

Contents?: true

Size: 560 Bytes

Versions: 6

Compression:

Stored size: 560 Bytes

Contents

use cap_std::time::{Duration, Instant, SystemTime};

pub enum SystemTimeSpec {
    SymbolicNow,
    Absolute(SystemTime),
}

pub trait WasiSystemClock: Send + Sync {
    fn resolution(&self) -> Duration;
    fn now(&self, precision: Duration) -> SystemTime;
}

pub trait WasiMonotonicClock: Send + Sync {
    fn resolution(&self) -> Duration;
    fn now(&self, precision: Duration) -> Instant;
}

pub struct WasiClocks {
    pub system: Box<dyn WasiSystemClock>,
    pub monotonic: Box<dyn WasiMonotonicClock>,
    pub creation_time: cap_std::time::Instant,
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
wasmtime-7.0.0 ./ext/cargo-vendor/wasi-common-7.0.0/src/clocks.rs
wasmtime-6.0.1 ./ext/cargo-vendor/wasi-common-6.0.1/src/clocks.rs
wasmtime-6.0.0 ./ext/cargo-vendor/wasi-common-6.0.0/src/clocks.rs
wasmtime-5.0.0 ./ext/cargo-vendor/wasi-common-5.0.0/src/clocks.rs
wasmtime-0.4.1 ./ext/cargo-vendor/wasi-common-4.0.0/src/clocks.rs
wasmtime-0.4.0 ./ext/cargo-vendor/wasi-common-4.0.0/src/clocks.rs