# ppoppo-clock
The time port of the ppoppo ecosystem: one `Clock` ("what time is it?") and
one `Timer` ("wake me in N ms"), injected wherever code needs time, so no
surface reads the ambient system clock directly.
## Usage
```rust
use ppoppo_clock::ArcClock;
fn stamp(clock: &ArcClock) -> i64 {
clock.now_unix_millis()
}
```
| `native` | `native::{NativeClock, NativeTimer, system_tz}` — the Tokio runtime |
| `wasm` | `wasm::{WasmClock, WasmTimer, browser_local_tz}` — the browser event loop (on `wasm32` only) |
| `mock` | `mock::{FrozenClock, MockClock, AdvanceableTimer, frozen_at, mock_pair}` — deterministic tests |
With no feature the crate is the two traits, their `Arc` aliases and the
family's one future alias, `BoxFuture` (`Send` everywhere but `wasm32`) — no
runtime, no IO. The port's value types are [jiff](https://docs.rs/jiff)'s
(`Timestamp`, `Zoned`, `tz::TimeZone`, `civil::Date`), re-exported as
`ppoppo_clock::jiff` so a consumer names one version of them.
Zone math is arm-independent: jiff's bundled tzdb makes `Clock::now_in` and
`Clock::today_in` provided methods, so each arm implements only `Clock::now`.
jiff is the Rust realization of the TC39 Temporal model (`Timestamp` ≙
`Temporal.Instant`, `Zoned` ≙ `Temporal.ZonedDateTime`, `civil::Date` ≙
`Temporal.PlainDate`), identically on every arm.
## Versioning
**STABLE VOCABULARY.** Nameable by any application and semver-versioned on its
own: the port's signature changes only on a major version. Every ppoppo face
takes and returns these traits, so a consumer holding an `ArcClock` built here
hands the same value to each face.
Read `CHANGELOG.md` for what actually moved.
## License
MIT OR Apache-2.0