pub struct TickAdvanceTime { /* private fields */ }
Available on crate feature
test-util
only.Expand description
Tick-advancing test time source implementation.
See module docs for more information.
Implementations§
source§impl TickAdvanceTime
impl TickAdvanceTime
sourcepub async fn tick(&self, duration: Duration)
pub async fn tick(&self, duration: Duration)
Advance time by duration
.
This will yield the async runtime after each sleep that presents between
the previous current time and the time after the given duration. This allows
for async tasks pending one of those sleeps to do some work and also create
additional sleep tasks. Created sleep tasks may also complete during this
call to tick()
if they present before the given time duration.
Trait Implementations§
source§impl Clone for TickAdvanceTime
impl Clone for TickAdvanceTime
source§fn clone(&self) -> TickAdvanceTime
fn clone(&self) -> TickAdvanceTime
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TickAdvanceTime
impl Debug for TickAdvanceTime
source§impl TimeSource for TickAdvanceTime
impl TimeSource for TickAdvanceTime
source§fn now(&self) -> SystemTime
fn now(&self) -> SystemTime
Returns the current time
Auto Trait Implementations§
impl Freeze for TickAdvanceTime
impl RefUnwindSafe for TickAdvanceTime
impl Send for TickAdvanceTime
impl Sync for TickAdvanceTime
impl Unpin for TickAdvanceTime
impl UnwindSafe for TickAdvanceTime
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)