Struct tokio_timer::timer::Handle [−][src]
pub struct Handle { /* fields omitted */ }
Handle to timer instance.
The Handle
allows creating Delay
instances that are driven by the
associated timer.
A Handle
is obtained by calling Timer::handle
.
Methods
impl Handle
[src]
impl Handle
pub fn current() -> Handle
[src]
pub fn current() -> Handle
Returns a handle to the current timer.
The current timer is the timer that is currently set as default using
with_default
.
This function should only be called from within the context of
with_default
. Calling this function from outside of this context
will return a Handle
that does not reference a timer. Delay
instances created with this handle will error.
pub fn delay(&self, deadline: Instant) -> Delay
[src]
pub fn delay(&self, deadline: Instant) -> Delay
Create a Delay
driven by this handle's associated Timer
.
pub fn deadline<T>(&self, future: T, deadline: Instant) -> Deadline<T>
[src]
pub fn deadline<T>(&self, future: T, deadline: Instant) -> Deadline<T>
Create a Deadline
driven by this handle's associated Timer
.
pub fn interval(&self, at: Instant, duration: Duration) -> Interval
[src]
pub fn interval(&self, at: Instant, duration: Duration) -> Interval
Create a new Interval
that starts at at
and yields every duration
interval after that.
Trait Implementations
impl Debug for Handle
[src]
impl Debug for Handle
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Handle
[src]
impl Clone for Handle