pub struct RealClock { /* private fields */ }Expand description
Production clock. Reads OffsetDateTime::now_utc() and
tokio::time::sleep. Honors tokio::time::pause() for sleep-driven
scheduling but now_utc always returns true wall time.
Implementations§
Trait Implementations§
Source§impl Clock for RealClock
impl Clock for RealClock
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 RealClock
impl RefUnwindSafe for RealClock
impl Send for RealClock
impl Sync for RealClock
impl Unpin for RealClock
impl UnsafeUnpin for RealClock
impl UnwindSafe for RealClock
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