pub struct TimerMember<'group> { /* private fields */ }Expand description
A one-shot timer owned by a CleanupGroup.
Behaves like ThreadpoolTimer but is released by the group rather than by
its own drop.
Implementations§
Source§impl TimerMember<'_>
impl TimerMember<'_>
Sourcepub fn set_at(&self, when: SystemTime)
pub fn set_at(&self, when: SystemTime)
Fire once at the wall-clock instant when.
Sourcepub fn is_set(&self) -> bool
pub fn is_set(&self) -> bool
Whether the timer currently has a due time.
As with ThreadpoolTimer::is_set, expiring does not clear the due
time; only disarming does.
Sourcepub fn stop_and_drain(&self)
pub fn stop_and_drain(&self)
Stop the timer and block until no firing is queued or executing.
The same drain ThreadpoolTimer::stop_and_drain performs, including
suppressing a re-arm a running callback asks for: without that the drain
could return with a due time installed, which is the whole reason the
standalone type has this method rather than only disarm and wait.
Added because a member that lacked it was not the equivalent of its
standalone twin that CleanupGroup::create_timer says it is.
Sourcepub fn cancel_pending(&self)
pub fn cancel_pending(&self)
Cancel callbacks that have not started, then wait for those that have.
Unlike the wait member’s method of the same name, this carries no process-wide hazard. The primitive that can sever a pool’s arrival-to-factory notification operates on a wait completion packet, which only a wait owns; a timer has none.