Skip to main content

dekopon_provider_clock/
lib.rs

1#![forbid(unsafe_code)]
2#![cfg_attr(test, allow(clippy::unwrap_used))]
3#![cfg_attr(
4    test,
5    allow(
6        clippy::disallowed_methods,
7        clippy::disallowed_types,
8        reason = "tests spawn, join and drain freely; production sites carry their own expectation"
9    )
10)]
11mod bindings {
12    wit_bindgen::generate!({
13        path: "wit",
14        world: "clock-client",
15        generate_all,
16    });
17}
18
19/// Call only from invoke; the broker host traps a component that reads the clock from describe or
20/// run-command, which must stay pure.
21#[must_use]
22pub fn now_unix_millis() -> u64 {
23    bindings::dekopon::clock::wall::now_unix_millis()
24}