Struct local_clock::MockLocalClock
source · pub struct MockLocalClock { /* private fields */ }
Expand description
A mock implementation of LocalClock
, which is manually ticked via a
MockLocalClockAccessor
. Useful for tests.
Implementations§
source§impl MockLocalClock
impl MockLocalClock
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new MockLocalClock
sourcepub fn accessor(&self) -> MockLocalClockAccessor
pub fn accessor(&self) -> MockLocalClockAccessor
Return a new MockLocalClockAccessor
, which can tick the clock.
Trait Implementations§
source§impl Debug for MockLocalClock
impl Debug for MockLocalClock
source§impl Inspect for MockLocalClock
impl Inspect for MockLocalClock
source§impl LocalClock for MockLocalClock
impl LocalClock for MockLocalClock
source§fn get_time(&mut self) -> LocalClockTime
fn get_time(&mut self) -> LocalClockTime
Return the current clock time. Read more
source§fn set_time(&mut self, new_time: LocalClockTime)
fn set_time(&mut self, new_time: LocalClockTime)
Set the current clock time.
Auto Trait Implementations§
impl Freeze for MockLocalClock
impl !RefUnwindSafe for MockLocalClock
impl Send for MockLocalClock
impl Sync for MockLocalClock
impl Unpin for MockLocalClock
impl !UnwindSafe for MockLocalClock
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