pub struct TestClock {
inner: Arc<Inner>,
}Fields§
§inner: Arc<Inner>Implementations§
Source§impl TestClock
impl TestClock
pub fn new(start_ms: i64) -> Self
pub fn advance(&self, ms: i64)
pub fn set(&self, ms: i64)
pub fn pending_sleepers(&self) -> usize
pub fn next_deadline(&self) -> Option<i64>
Sourcepub async fn run_until_idle(&self)
pub async fn run_until_idle(&self)
Drive virtual time: once every runnable task has parked on a sleep
(the sleeper set is stable for 32 consecutive yields), jump to the
earliest deadline. Never returns; use inside tokio::select! on a
current-thread runtime.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TestClock
impl RefUnwindSafe for TestClock
impl Send for TestClock
impl Sync for TestClock
impl Unpin for TestClock
impl UnsafeUnpin for TestClock
impl UnwindSafe for TestClock
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