pub struct RobotClock { /* private fields */ }
Expand description
A running Robot clock. The clock is a monotonic clock that starts at an arbitrary reference time. It is clone resilient, ie a clone will be the same clock, even when mocked.
Implementations§
Source§impl RobotClock
impl RobotClock
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a RobotClock using now as its reference time. It will start a 0ns incrementing monotonically.
Sourcepub fn from_ref_time(ref_time_ns: u64) -> Self
pub fn from_ref_time(ref_time_ns: u64) -> Self
Builds a monotonic clock starting at the given reference time.
Sourcepub fn mock() -> (Self, RobotClockMock)
pub fn mock() -> (Self, RobotClockMock)
Build a fake clock with a reference time of 0. The RobotMock interface enables you to control all the clones of the clock given.
pub fn now(&self) -> CuTime
pub fn recent(&self) -> CuTime
Trait Implementations§
Source§impl Clone for RobotClock
impl Clone for RobotClock
Source§fn clone(&self) -> RobotClock
fn clone(&self) -> RobotClock
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 RobotClock
impl Debug for RobotClock
Auto Trait Implementations§
impl Freeze for RobotClock
impl RefUnwindSafe for RobotClock
impl Send for RobotClock
impl Sync for RobotClock
impl Unpin for RobotClock
impl UnwindSafe for RobotClock
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