Library guide · API index and notation
This page is generated from the bundled library in this checkout. Signatures and adjacent source comments are reproduced below; the linked guide explains usage, storage, failures, and platform support.
import "std/time/hosted"
Names used in signatures
Unqualified names denote this package’s types (including other source files in the same package), language built-ins, or generic parameters such as T. Qualified names use the import aliases below. These aliases belong to the library source; import a dependency yourself to use its alias in your program.
| Alias | Package | Source file |
|---|---|---|
backend |
std/time/native |
hosted.dodo |
error |
std/platform/error |
hosted.dodo |
ptr |
core/ptr |
hosted.dodo |
time |
std/time |
hosted.dodo |
MONOTONIC_ID
Constant · Source
Reserved native monotonic domain. All instances on this OS share an origin. Custom/FakeClock providers must use another ID. Timestamps are process-local observations, never persistent identifiers or portable serialized deadlines.
pub const MONOTONIC_ID: u64 = 18446744073709551614
MonotonicClock
Struct · Source
pub struct MonotonicClock {
}
MonotonicClock.new
Function · Source
pub fn new() -> MonotonicClock
MonotonicClock.now_native
Function · Source
Clock-provider failures retain their native code with kind Other. The contract-facing methods below map them to ClockFailure.
pub fn now_native(&self) -> time.Instant!error.Error
MonotonicClock.now
Function · Source
pub fn now(&self) -> time.Instant!time.TimeError
MonotonicClock.now_ms
Function · Source
Structural std/net clock compatibility. Failure returns the maximum timestamp, preserving network deadline checks’ fail-closed convention.
pub fn now_ms(&mut self) -> u64
WallClock
Struct · Source
pub struct WallClock {
}
WallClock.new
Function · Source
pub fn new() -> WallClock
WallClock.wall_now_native
Function · Source
pub fn wall_now_native(&self) -> time.Timestamp!error.Error
WallClock.wall_now
Function · Source
pub fn wall_now(&self) -> time.Timestamp!time.TimeError