//! Clock injection. //! //! `heph-core` never reads the ambient wall clock (tech-spec §2): the current //! time is always supplied through a [`Clock`]. This keeps ranking and //! recurrence deterministic and testable. The daemon wires in a real //! system clock; tests wire in a [`FixedClock`]. /// Source of the current time, in epoch milliseconds. pub trait Clock: Send + Sync { /// Current time as epoch milliseconds. fn now_ms(&self) -> i64; } /// A clock pinned to a fixed instant — for deterministic tests. #[derive(Debug, Clone, Copy)] pub struct FixedClock(pub i64); impl Clock for FixedClock { fn now_ms(&self) -> i64 { self.0 } }