Struct os_timer::Timer [−][src]
pub struct Timer { /* fields omitted */ }Expand description
Posix timer wrapper
Implementations
Creates new uninitialized instance.
In order to use it one must call init.
Performs timer initialization
cb pointer to function to invoke when timer expires.
Returns whether timer has been initialized successfully or not.
If timer is already initialized does nothing, returning false.
Creates new timer, invoking provided cb when timer expires.
On failure, returns None
Schedules timer to alarm periodically with interval with initial alarm of timeout.
Note that if timer has been scheduled before, but hasn’t expire yet, it shall be cancelled.
To prevent that user must cancel timer first.
Returns true if successfully set, otherwise on error returns false
Returns true if timer has been scheduled and still pending.
On Win/Mac it only returns whether timer has been scheduled, as there is no way to check whether timer is ongoing
Schedules timer to alarm once after timeout passes.
Note that if timer has been scheduled before, but hasn’t expire yet, it shall be cancelled.
To prevent that user must cancel timer first.
Returns true if successfully set, otherwise on error returns false