pub struct Timer { /* private fields */ }
Expand description

A timer event source

When registered to the event loop, it will trigger an event once its deadline is reached. If the deadline is in the past relative to the moment of its insertion in the event loop, the TImer will trigger an event as soon as the event loop is dispatched.

Implementations

Create a timer that will fire immediately when inserted in the event loop

Create a timer that will fire after a given duration from now

Create a timer that will fire at a given instant

Changes the deadline of this timer to an Instant

If the Timer is currently registered in the event loop, it needs to be re-registered for this change to take effect.

Changes the deadline of this timer to a Duration from now

If the Timer is currently registered in the event loop, it needs to be re-registered for this change to take effect.

Get the current deadline of this Timer

Trait Implementations

Formats the value using the given formatter. Read more
The type of events generated by your source.
Some metadata of your event source Read more
The return type of the user callback Read more
The error type returned from process_events() (not the user callback!). Read more
Process any relevant events Read more
Register yourself to this poll instance Read more
Re-register your file descriptors Read more
Unregister your file descriptors Read more
Notification that a polling session is going to start Read more
Notification that the current polling session ended Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.