pub struct RecordedClock { /* private fields */ }Expand description
Wraps an inner Clock and records every observation to a
ClockEventLog.
The recording is the substrate the testbench replay/recording feature (#1441) builds on. It is deliberately scoped to the clock surface; other I/O substrates record separately.
Implementations§
Source§impl RecordedClock
impl RecordedClock
pub fn new(inner: Arc<dyn Clock>, log: Arc<ClockEventLog>) -> Self
pub fn log(&self) -> Arc<ClockEventLog>
Trait Implementations§
Source§impl Clock for RecordedClock
impl Clock for RecordedClock
Source§fn now_utc(&self) -> OffsetDateTime
fn now_utc(&self) -> OffsetDateTime
Current wall-clock UTC time.
Source§fn monotonic_ms(&self) -> i64
fn monotonic_ms(&self) -> i64
Monotonic milliseconds since an implementation-defined origin. Read more
Source§fn sleep<'life0, 'async_trait>(
&'life0 self,
duration: Duration,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sleep<'life0, 'async_trait>(
&'life0 self,
duration: Duration,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sleep for
duration. No-op when duration is zero.Source§fn sleep_until_utc<'life0, 'async_trait>(
&'life0 self,
deadline: OffsetDateTime,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sleep_until_utc<'life0, 'async_trait>(
&'life0 self,
deadline: OffsetDateTime,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sleep until the wall-clock UTC
deadline. No-op if deadline is in
the past.Auto Trait Implementations§
impl Freeze for RecordedClock
impl !RefUnwindSafe for RecordedClock
impl Send for RecordedClock
impl Sync for RecordedClock
impl Unpin for RecordedClock
impl UnsafeUnpin for RecordedClock
impl !UnwindSafe for RecordedClock
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