pub struct PeriodicTimerMember<'group> { /* private fields */ }Expand description
A periodic timer owned by a CleanupGroup.
Behaves like ThreadpoolPeriodicTimer – including that its ticks may run
concurrently with one another – but is released by the group rather than by
its own drop.
Implementations§
Source§impl PeriodicTimerMember<'_>
impl PeriodicTimerMember<'_>
Sourcepub fn start_after(&self, first_delay: Duration)
pub fn start_after(&self, first_delay: Duration)
Start ticking, with the first tick first_delay from now.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Whether the timer is currently started.
Sourcepub fn stop_and_drain(&self)
pub fn stop_and_drain(&self)
Stop the timer and wait until no tick is queued or executing.
The same drain ThreadpoolPeriodicTimer::stop_and_drain performs,
including that it holds only provided no other thread starts the member
during the call: the start* methods take &self, so a start landing
between the stop and the drain would leave a schedule installed on
return.
Trait Implementations§
Source§impl<'group> Debug for PeriodicTimerMember<'group>
impl<'group> Debug for PeriodicTimerMember<'group>
impl Send for PeriodicTimerMember<'_>
impl Sync for PeriodicTimerMember<'_>
Auto Trait Implementations§
impl<'group> Freeze for PeriodicTimerMember<'group>
impl<'group> RefUnwindSafe for PeriodicTimerMember<'group>
impl<'group> Unpin for PeriodicTimerMember<'group>
impl<'group> UnsafeUnpin for PeriodicTimerMember<'group>
impl<'group> UnwindSafe for PeriodicTimerMember<'group>
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