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§
Sourcefn status(&self) -> ThreadStatus
fn status(&self) -> ThreadStatus
Get the status of the worker thread
Get the shared state
Sourcefn send_command(&self, command: DeviceCommand) -> Result<()>
fn send_command(&self, command: DeviceCommand) -> Result<()>
Send a command to the worker thread
Sourcefn command_sender(&self) -> &Sender<DeviceCommand>
fn command_sender(&self) -> &Sender<DeviceCommand>
Get the command sender
Sourcefn set_log_level(&mut self, level: LevelFilter) -> Result<()>
fn set_log_level(&mut self, level: LevelFilter) -> Result<()>
Set the log level