DeviceWorker

Trait DeviceWorker 

Source
pub trait DeviceWorker {
    // Required methods
    fn start(&mut self) -> Result<()>;
    fn stop(&mut self) -> Result<()>;
    fn pause(&mut self) -> Result<()>;
    fn resume(&mut self) -> Result<()>;
    fn status(&self) -> ThreadStatus;
    fn shared_state(&self) -> Arc<SharedDeviceState>;
    fn send_command(&self, command: DeviceCommand) -> Result<()>;
    fn command_sender(&self) -> &Sender<DeviceCommand>;
    fn set_log_level(&mut self, level: LevelFilter) -> Result<()>;
}
Expand description

Device worker that runs in its own thread

Required Methods§

Source

fn start(&mut self) -> Result<()>

Start the worker thread

Source

fn stop(&mut self) -> Result<()>

Stop the worker thread

Source

fn pause(&mut self) -> Result<()>

Pause the worker thread

Source

fn resume(&mut self) -> Result<()>

Resume the worker thread

Source

fn status(&self) -> ThreadStatus

Get the status of the worker thread

Source

fn shared_state(&self) -> Arc<SharedDeviceState>

Get the shared state

Source

fn send_command(&self, command: DeviceCommand) -> Result<()>

Send a command to the worker thread

Source

fn command_sender(&self) -> &Sender<DeviceCommand>

Get the command sender

Source

fn set_log_level(&mut self, level: LevelFilter) -> Result<()>

Set the log level

Implementors§