pub struct ManualClock { /* private fields */ }Expand description
A Clock a test moves by hand (issue #583), for a fake whose behaviour
depends on time — MemoryActors fires an alarm once the clock reaches
it. Every clone shares the one instant, so the host and the test that
advances it never diverge.
Implementations§
Source§impl ManualClock
impl ManualClock
Trait Implementations§
Source§impl Clock for ManualClock
impl Clock for ManualClock
fn now(&self) -> OffsetDateTime
Source§fn timeout_any<'life0, 'async_trait>(
&'life0 self,
fut: Pin<Box<dyn Future<Output = Box<dyn Any + Send>> + Send>>,
after: Duration,
) -> Pin<Box<dyn Future<Output = Option<Box<dyn Any + Send>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn timeout_any<'life0, 'async_trait>(
&'life0 self,
fut: Pin<Box<dyn Future<Output = Box<dyn Any + Send>> + Send>>,
after: Duration,
) -> Pin<Box<dyn Future<Output = Option<Box<dyn Any + Send>>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: '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 ManualClock
impl Clone for ManualClock
Auto Trait Implementations§
impl Freeze for ManualClock
impl RefUnwindSafe for ManualClock
impl Send for ManualClock
impl Sync for ManualClock
impl Unpin for ManualClock
impl UnsafeUnpin for ManualClock
impl UnwindSafe for ManualClock
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