//! Pluggable clock — foundation's `now()` defaults to `Utc::now()` but can be
//! overridden (e.g., by `mockforge-core::time_travel`) via `set_clock`.
//!
//! This allows foundation types like `SessionState` to respect time travel
//! without depending on `mockforge-core`.
use ;
use OnceLock;
/// Type alias for a clock function (returns the current time).
pub type ClockFn = fn ;
static CLOCK: = new;
/// Returns the current time. Uses the registered clock function if any,
/// otherwise falls back to real wall-clock time (`Utc::now()`).
/// Register a custom clock function. Can only be called once per process;
/// subsequent calls are silently ignored (returns `Err` if already set).
///
/// This is intended for `mockforge-core::time_travel` to register its virtual
/// clock once at startup.