Struct governor::clock::FakeRelativeClock
source · pub struct FakeRelativeClock { /* private fields */ }
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§
source§impl Clock for FakeRelativeClock
impl Clock for FakeRelativeClock
source§impl Clone for FakeRelativeClock
impl Clone for FakeRelativeClock
source§fn clone(&self) -> FakeRelativeClock
fn clone(&self) -> FakeRelativeClock
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for FakeRelativeClock
impl Debug for FakeRelativeClock
source§impl Default for FakeRelativeClock
impl Default for FakeRelativeClock
source§fn default() -> FakeRelativeClock
fn default() -> FakeRelativeClock
Returns the “default value” for a type. Read more
source§impl PartialEq for FakeRelativeClock
impl PartialEq for FakeRelativeClock
Auto Trait Implementations§
impl Freeze for FakeRelativeClock
impl RefUnwindSafe for FakeRelativeClock
impl Send for FakeRelativeClock
impl Sync for FakeRelativeClock
impl Unpin for FakeRelativeClock
impl UnwindSafe for FakeRelativeClock
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)