Expand description
Universal Clock + Timer port for the ppoppo workspace.
Single deep-module port hiding the time-source substrate from every consumer.
Three impl arms gated by feature: native (Tokio + time-tz), wasm (Intl +
Promise + leptos::set_timeout), mock (FrozenClock + MockClock + AdvanceableTimer).
§SSOT relationship
Standards: STANDARDS_TIME_MECHANICS.md §“Universal client + server time port”
(rewritten in RFC_2026-05-10 Slice 9). Engine precedent: ppoppo-token
(1st-party-consumed primitive, surface via SDK re-export). External Developer
Apps consume via pas_external::clock::* — never path-dep this crate.
§Dart mirror (CFC)
apps/cfc/lib/clock.dart is the hand-maintained Dart shape mirror. Drift
detection deferred to a follow-up RFC. When changing trait shape here,
update the Dart mirror in the same commit.
§Temporal API readiness
Trait shape is deliberately Temporal-aligned. When js_sys::Temporal::*
lands in upstream, only src/wasm.rs changes — public traits unchanged.
See RFC §5.
Structs§
- Local
Parts - Calendar / wall-clock components in a specific timezone.
- Tz
- Validated IANA timezone identifier (e.g.
"Asia/Seoul","UTC"). - Zoned
Date Time - A UTC instant paired with the timezone it should be displayed in.
Enums§
Traits§
- Clock
- Wall-clock readouts. Single port for “what time is it?” across all surfaces.
- Timer
- Async scheduling primitive. Single port for “wait N ms” / “yield event-loop tick”.