Struct governor::clock::FakeRelativeClock [−][src]
pub struct FakeRelativeClock { /* fields omitted */ }
Expand description
A mock implementation of a clock. All it does is keep track of what “now” is (relative to some point meaningful to the program), and returns that.
Thread safety
The mock time is represented as an atomic u64 count of nanoseconds, behind an Arc
.
Clones of this clock will all show the same time, even if the original advances.
Implementations
Trait Implementations
Returns the “default value” for a type. Read more
Compares two fake relative clocks’ current state, snapshotted.
let clock1 = FakeRelativeClock::default();
let clock2 = FakeRelativeClock::default();
assert_eq!(clock1, clock2);
clock1.advance(Duration::from_secs(1));
assert_ne!(clock1, clock2);
Auto Trait Implementations
impl RefUnwindSafe for FakeRelativeClock
impl Send for FakeRelativeClock
impl Sync for FakeRelativeClock
impl Unpin for FakeRelativeClock
impl UnwindSafe for FakeRelativeClock
Blanket Implementations
Mutably borrows from an owned value. Read more