Skip to main content

UiRuntimeDriver

Trait UiRuntimeDriver 

Source
pub trait UiRuntimeDriver {
    type Error;

    // Required methods
    fn idle_poll_ms(&self) -> u32;
    fn active_poll_ms(&self) -> u32;
    fn needs_active_poll(&self) -> bool;
    fn delay_ms(&mut self, delay_ms: u32);
    fn now_ms(&self) -> u32;
    fn poll_touch(
        &mut self,
        now_ms: u32,
    ) -> Result<Option<TouchEvent>, Self::Error>;
}
Expand description

OEM-owned timing and touch adapter used by run_ui_system.

Required Associated Types§

Source

type Error

Driver-specific error type.

Required Methods§

Source

fn idle_poll_ms(&self) -> u32

Poll interval used while the UI is idle.

Source

fn active_poll_ms(&self) -> u32

Poll interval used while the UI is actively animating or tracking touch.

Source

fn needs_active_poll(&self) -> bool

Returns true when the runtime should use Self::active_poll_ms.

Source

fn delay_ms(&mut self, delay_ms: u32)

Sleeps or yields for the requested duration.

Source

fn now_ms(&self) -> u32

Returns the current monotonic time in milliseconds.

Source

fn poll_touch(&mut self, now_ms: u32) -> Result<Option<TouchEvent>, Self::Error>

Polls the current touch source.

Implementors§