pub struct SystemClock;Expand description
Real wall clock (time crate). Its timeout runs futures to completion —
tests that need a real timeout supply their own clock.
Trait Implementations§
Source§impl Clock for SystemClock
impl Clock for SystemClock
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 SystemClock
impl Clone for SystemClock
Source§fn clone(&self) -> SystemClock
fn clone(&self) -> SystemClock
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SystemClock
Source§impl Debug for SystemClock
impl Debug for SystemClock
Source§impl Default for SystemClock
impl Default for SystemClock
Source§fn default() -> SystemClock
fn default() -> SystemClock
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SystemClock
impl RefUnwindSafe for SystemClock
impl Send for SystemClock
impl Sync for SystemClock
impl Unpin for SystemClock
impl UnsafeUnpin for SystemClock
impl UnwindSafe for SystemClock
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