pub trait Clock:
Send
+ Sync
+ BoxedClockClone {
// Required method
fn now(&self) -> SystemTime;
// Provided method
fn has_passed(&self, time: &SystemTime) -> bool { ... }
}Expand description
Clock represents a trait to get the current std::time::SystemTime.
The default implementation of Clock is SystemClock.
Clients can provide their implementation of Clock using crate::cache::config::Config and
since Clock is considered to be a lightweight object, Clock is of type BoxedClockClone.