DisplayController

Trait DisplayController 

Source
pub trait DisplayController: Send + Sync {
    // Required methods
    fn get_state(&self) -> ControllerState;
    fn refresh_sliders(&self) -> Result<(), ControllerError>;
    fn sync_all_sliders(&self) -> Result<(), ControllerError>;
    fn set_dimming(&self, level: i32) -> Result<(), ControllerError>;
    fn set_dimming_percent(&self, percent: i32) -> Result<(), ControllerError>;
    fn get_current_mode(&self) -> Result<Box<dyn DisplayMode>, ControllerError>;
    fn set_mode(&self, mode: &dyn DisplayMode) -> Result<(), ControllerError>;
    fn toggle_e_reading(&self) -> Result<Box<dyn DisplayMode>, ControllerError>;
}
Expand description

Trait for display controller implementations.

This allows for mock implementations in tests.

Required Methods§

Source

fn get_state(&self) -> ControllerState

Get a snapshot of the current controller state.

Source

fn refresh_sliders(&self) -> Result<(), ControllerError>

Refresh slider values from the device.

Source

fn sync_all_sliders(&self) -> Result<(), ControllerError>

Sync all slider values from hardware.

Source

fn set_dimming(&self, level: i32) -> Result<(), ControllerError>

Set the display dimming level (40-100 in splendid units).

Source

fn set_dimming_percent(&self, percent: i32) -> Result<(), ControllerError>

Set dimming using percentage (0-100).

Source

fn get_current_mode(&self) -> Result<Box<dyn DisplayMode>, ControllerError>

Get the current display mode.

Source

fn set_mode(&self, mode: &dyn DisplayMode) -> Result<(), ControllerError>

Set a display mode.

Source

fn toggle_e_reading(&self) -> Result<Box<dyn DisplayMode>, ControllerError>

Toggle e-reading mode on/off.

Implementors§