pub trait Clock:
Send
+ Sync
+ 'static {
// Required methods
fn unix_secs(&self) -> i64;
fn unix_millis(&self) -> i64;
fn instant(&self) -> Instant;
fn sleep(&self, d: Duration) -> Pin<Box<dyn Future<Output = ()> + Send>>;
}Expand description
Source of time. Production code uses SystemClock; tests use ManualClock (feature
test-util).
Required Methods§
Sourcefn unix_millis(&self) -> i64
fn unix_millis(&self) -> i64
Unix milliseconds, 0 for a clock before 1970.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".