API referencestd/time

std/time/hosted

Public declarations, types, methods, and source contracts for std/time/hosted.

On this page

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

local_time_fields

Function · Source

Converts seconds since the Unix epoch to local time with the operating system’s time zone rules (localtime_r, or _localtime64_s on Windows). Writes [second, minute, hour, day of month, month 0-11, year - 1900, weekday 0-6 from Sunday, day of year 0-365, DST flag] to fields[0..9] and returns false when the OS cannot represent the time. fields needs at least nine elements.

pub fn local_time_fields(seconds: i64, fields: &mut[i32]) -> bool

Search every guide, reference page, and API declaration.