pub struct TimerHandle(/* private fields */);Expand description
Handle to an I/O dispatcher timer.
Handles represent second-granularity deadlines managed by the current
thread’s I/O manager, a timer started with a t seconds timeout expires
after at least t and less than t + 1 seconds. The timer clock starts
a new second when a timer starts while no other timers are pending, such
a timer expires after t seconds. A handle becomes stale
after its timer is stopped or replaced and must not be used as an
independent cancellation token.
Implementations§
Source§impl TimerHandle
impl TimerHandle
Sourcepub const ZERO: TimerHandle
pub const ZERO: TimerHandle
A handle that does not refer to an active timer.
Sourcepub fn is_set(&self) -> bool
pub fn is_set(&self) -> bool
Returns true if this handle refers to a timer deadline.
This does not guarantee that the timer is still registered or has not already elapsed.
Trait Implementations§
Source§impl Add<Seconds> for TimerHandle
impl Add<Seconds> for TimerHandle
Source§type Output = TimerHandle
type Output = TimerHandle
The resulting type after applying the
+ operator.Source§impl Clone for TimerHandle
impl Clone for TimerHandle
Source§fn clone(&self) -> TimerHandle
fn clone(&self) -> TimerHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TimerHandle
Source§impl Debug for TimerHandle
impl Debug for TimerHandle
Source§impl Default for TimerHandle
impl Default for TimerHandle
Source§fn default() -> TimerHandle
fn default() -> TimerHandle
Returns the “default value” for a type. Read more
impl Eq for TimerHandle
Source§impl Hash for TimerHandle
impl Hash for TimerHandle
Source§impl Ord for TimerHandle
impl Ord for TimerHandle
Source§fn cmp(&self, other: &TimerHandle) -> Ordering
fn cmp(&self, other: &TimerHandle) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for TimerHandle
impl PartialEq for TimerHandle
Source§impl PartialOrd for TimerHandle
impl PartialOrd for TimerHandle
impl StructuralPartialEq for TimerHandle
Auto Trait Implementations§
impl Freeze for TimerHandle
impl RefUnwindSafe for TimerHandle
impl Send for TimerHandle
impl Sync for TimerHandle
impl Unpin for TimerHandle
impl UnsafeUnpin for TimerHandle
impl UnwindSafe for TimerHandle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.