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§
Sourcefn cancel(&mut self) -> bool
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.
Returns true
if the timer was running.