/// A source of the current time, so domain/application code doesn't call
/// [`chrono::Utc::now`] directly and become untestable.
pubtraitClock: Send + Sync {/// The current time.
fnnow(&self)->chrono::DateTime<chrono::Utc>;}#[cfg(test)]modtest{usesuper::*;structFixedClock(chrono::DateTime<chrono::Utc>);implClock forFixedClock{fnnow(&self)->chrono::DateTime<chrono::Utc>{self.0}}#[test]fnfixed_clock_test_double_returns_configured_time(){let time =chrono::DateTime::parse_from_rfc3339("2026-07-19T00:00:00Z").unwrap().with_timezone(&chrono::Utc);let clock:&dyn Clock =&FixedClock(time);assert_eq!(clock.now(), time);}#[test]fnclock_implementors_are_send_and_sync(){fnassert_send_sync<T:Send+Sync+?Sized>(){}assert_send_sync::<FixedClock>();assert_send_sync::<dyn Clock>();}}