pub struct TokioClock;Expand description
The system clock on tokio. now() reads the wall clock through the
time crate (the same path core’s SystemClock uses, never
std::time directly); timeout_any abandons the future with
tokio::time::timeout, which this runtime can always supply.
Trait Implementations§
Source§impl Clock for TokioClock
impl Clock for TokioClock
fn now(&self) -> OffsetDateTime
Source§fn timeout_any<'life0, 'async_trait>(
&'life0 self,
fut: BoxFuture<'static, Box<dyn Any + Send>>,
after: Duration,
) -> Pin<Box<dyn Future<Output = Option<Box<dyn Any + Send>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn timeout_any<'life0, 'async_trait>(
&'life0 self,
fut: BoxFuture<'static, Box<dyn Any + Send>>,
after: Duration,
) -> Pin<Box<dyn Future<Output = Option<Box<dyn Any + Send>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Runs
fut to completion, abandoning it after after elapses.
Returns None on timeout. Default: runs to completion (no timer;
test-only — runtimes override).Source§impl Clone for TokioClock
impl Clone for TokioClock
impl Copy for TokioClock
Source§impl Debug for TokioClock
impl Debug for TokioClock
Auto Trait Implementations§
impl Freeze for TokioClock
impl RefUnwindSafe for TokioClock
impl Send for TokioClock
impl Sync for TokioClock
impl Unpin for TokioClock
impl UnsafeUnpin for TokioClock
impl UnwindSafe for TokioClock
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