TimerOps

Trait TimerOps 

Source
pub trait TimerOps:
    Send
    + Sync
    + 'static {
    // Required methods
    fn start(
        &self,
        current_task: &CurrentTask,
        source: Option<Weak<dyn OnWakeOps>>,
        deadline: TargetTime,
    ) -> Result<(), Errno>;
    fn stop(&self, kernel: &Arc<Kernel>) -> Result<(), Errno>;
    fn as_handle_ref(&self) -> HandleRef<'_>;
    fn get_timeline_change_observer(
        &self,
        current_task: &CurrentTask,
    ) -> Option<TimelineChangeObserver>;
}

Required Methods§

Source

fn start( &self, current_task: &CurrentTask, source: Option<Weak<dyn OnWakeOps>>, deadline: TargetTime, ) -> Result<(), Errno>

Starts the timer with the specified deadline.

This method should start the timer and schedule it to trigger at the specified deadline. The timer should be cancelled if it is already running.

Source

fn stop(&self, kernel: &Arc<Kernel>) -> Result<(), Errno>

Stops the timer.

This method should stop the timer and prevent it from triggering.

Source

fn as_handle_ref(&self) -> HandleRef<'_>

Returns a reference to the underlying Zircon handle.

Source

fn get_timeline_change_observer( &self, current_task: &CurrentTask, ) -> Option<TimelineChangeObserver>

For TimerOps that support monitoring timeline changes (e.g. timers on the UTC timeline), this returns a an object that counts the number of timeline changes since last reset.

The caller must reset this value to restart the counting.

Implementors§