pub struct TimerEventService { /* private fields */ }Expand description
TimerEventService — starts a worker thread.
Implementations§
Source§impl TimerEventService
impl TimerEventService
Sourcepub fn create_one_shot(
&self,
delay: Duration,
cb: Arc<dyn TimerCallback>,
) -> TimerHandle
pub fn create_one_shot( &self, delay: Duration, cb: Arc<dyn TimerCallback>, ) -> TimerHandle
Creates a one-shot timer that fires after delay.
Sourcepub fn create_periodic(
&self,
period: Duration,
cb: Arc<dyn TimerCallback>,
) -> TimerHandle
pub fn create_periodic( &self, period: Duration, cb: Arc<dyn TimerCallback>, ) -> TimerHandle
Creates a periodic timer with a period interval.
Sourcepub fn cancel(&self, handle: TimerHandle) -> bool
pub fn cancel(&self, handle: TimerHandle) -> bool
Cancels a timer.
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Number of active timers.
Trait Implementations§
Source§impl Debug for TimerEventService
impl Debug for TimerEventService
Source§impl Default for TimerEventService
impl Default for TimerEventService
Source§impl Drop for TimerEventService
impl Drop for TimerEventService
Auto Trait Implementations§
impl !RefUnwindSafe for TimerEventService
impl !UnwindSafe for TimerEventService
impl Freeze for TimerEventService
impl Send for TimerEventService
impl Sync for TimerEventService
impl Unpin for TimerEventService
impl UnsafeUnpin for TimerEventService
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