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 duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const 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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more