pub(crate) struct Handle {
pub(super) time_source: TimeSource,
pub(super) inner: Inner,
}
Expand description
Handle to time driver instance.
Fields§
§time_source: TimeSource
§inner: Inner
Implementations§
source§impl Handle
impl Handle
sourcepub(crate) fn time_source(&self) -> &TimeSource
pub(crate) fn time_source(&self) -> &TimeSource
Returns the time source associated with this handle.
sourcepub(super) fn is_shutdown(&self) -> bool
pub(super) fn is_shutdown(&self) -> bool
Checks whether the driver has been shutdown.
source§impl Handle
impl Handle
fn process_at_time(&self, start: u32, now: u64)
fn process_at_sharded_time(&self, id: u32, now: u64) -> Option<u64>
sourceunsafe fn clear_entry(&self, entry: NonNull<TimerShared>)
unsafe fn clear_entry(&self, entry: NonNull<TimerShared>)
Removes a registered timer from the driver.
The timer will be moved to the cancelled state. Wakers will not be invoked. If the timer is already completed, this function is a no-op.
This function always acquires the driver lock, even if the entry does not appear to be registered.
SAFETY: The timer must not be registered with some other driver, and
add_entry
must not be called concurrently.
sourceunsafe fn reregister(
&self,
unpark: &IoHandle,
new_tick: u64,
entry: NonNull<TimerShared>,
)
unsafe fn reregister( &self, unpark: &IoHandle, new_tick: u64, entry: NonNull<TimerShared>, )
Removes and re-adds an entry to the driver.
SAFETY: The timer must be either unregistered, or registered with this
driver. No other threads are allowed to concurrently manipulate the
timer at all (the current thread should hold an exclusive reference to
the TimerEntry
)