Skip to main content

TimeSource

Trait TimeSource 

pub trait TimeSource: Send + Sync {
    // Required method
    fn now(&self) -> SystemTime;
}
Available on crate feature quic only.
Expand description

Object to get current SystemTime

This exists to allow system time to be mocked in tests, or wherever else desired.

Required Methods§

fn now(&self) -> SystemTime

Get SystemTime::now() or the mocked equivalent

Implementors§