[−][src]Trait async_timer::Timer
Describes Timer interface
Required methods
fn new(state: *const TimerState) -> Self
Creates new instance
TimerState is provided as pointer
due to it being managed by abstraction that uses Timer
It must be valid non-null pointer and is intended to be used with callbacks
that accept pointer for user's provided data
fn reset(&mut self)
Resets timer, and cancells ongoing work, if necessary
fn start_delay(&mut self, timeout: Duration)
Starts timer as one-shot with specified timeout.
After timer is expired, TimerState will remove registered waker, if any
Cancels any non-expired jobs
fn start_interval(&mut self, interval: Duration)
Starts timer as periodic with specified interval.
Cancels any non-expired jobs
fn state(&self) -> &TimerState
Accesses state
Provided methods
fn register_waker(&self, waker: &Waker)
Registers waker with Timer