Trait HrTimerHandle

Source
pub unsafe trait HrTimerHandle {
    // Required method
    fn cancel(&mut self) -> bool;
}
Expand description

A handle representing a potentially running timer.

More than one handle representing the same timer might exist.

§Safety

When dropped, the timer represented by this handle must be cancelled, if it is running. If the timer handler is running when the handle is dropped, the drop method must wait for the handler to return before returning.

Note: One way to satisfy the safety requirement is to call Self::cancel in the drop implementation for Self.

Required Methods§

Source

fn cancel(&mut self) -> bool

Cancel the timer. If the timer is in the running state, block till the handler has returned.

Note that the timer might be started by a concurrent start operation. If so, the timer might not be in the stopped state when this function returns.

Implementors§

Source§

impl<'a, T> HrTimerHandle for PinHrTimerHandle<'a, T>
where T: HasHrTimer<T>,

Source§

impl<'a, T> HrTimerHandle for PinMutHrTimerHandle<'a, T>
where T: HasHrTimer<T>,

Source§

impl<T> HrTimerHandle for ArcHrTimerHandle<T>
where T: HasHrTimer<T>,

Source§

impl<T, A> HrTimerHandle for BoxHrTimerHandle<T, A>
where T: HasHrTimer<T>, A: Allocator,