pub struct SchedulerClient { /* private fields */ }Implementations§
Source§impl SchedulerClient
impl SchedulerClient
Sourcepub fn schedule_event<F: FnOnce() + Send + Sync + 'static>(
&self,
callback: F,
timeout: Duration,
)
pub fn schedule_event<F: FnOnce() + Send + Sync + 'static>( &self, callback: F, timeout: Duration, )
Schedules a new event.
Once timeout is elapsed, the future fut is
executed.
fut will be executed in the scheduler task, so it is
required to be short.
Sourcepub fn accelerate_time(&self)
pub fn accelerate_time(&self)
Switch accelerated time mode for the scheduler.
The scheduler will jump in time whenever there are no more NoAdvanceInTimeGuard.
pub async fn sleep(&self, duration: Duration)
pub async fn timeout<O>( &self, duration: Duration, fut: impl Future<Output = O>, ) -> Result<O, ()>
Sourcepub fn no_advance_time_guard(&self) -> NoAdvanceTimeGuard
pub fn no_advance_time_guard(&self) -> NoAdvanceTimeGuard
Returns a NoAdvanceTimeGuard which calls inc_no_advance_time
on NoAdvanceTimeGuard::new and dec_no_advance_time when dropped.
Trait Implementations§
Source§impl Clone for SchedulerClient
impl Clone for SchedulerClient
Source§fn clone(&self) -> SchedulerClient
fn clone(&self) -> SchedulerClient
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for SchedulerClient
impl RefUnwindSafe for SchedulerClient
impl Send for SchedulerClient
impl Sync for SchedulerClient
impl Unpin for SchedulerClient
impl UnwindSafe for SchedulerClient
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