pub trait DeviceBackend: Send + Sync {
// Required methods
fn list(&self, emit: &mut dyn FnMut(&str, &str, &str) -> bool);
fn driver_for_device(
&self,
device_id: &str,
device_uri: &str,
) -> Option<String>;
// Provided method
fn poll_status(&self, _config: &PrinterConfig) -> Option<PrinterReason> { ... }
}Expand description
Enumerate physical printers and report their live health.
Implementations describe how to discover devices (e.g. via sysfs, BlueZ, USB enumeration) and how to map their identifying strings to a driver name registered with the framework.
Required Methods§
Provided Methods§
Sourcefn poll_status(&self, _config: &PrinterConfig) -> Option<PrinterReason>
fn poll_status(&self, _config: &PrinterConfig) -> Option<PrinterReason>
Query live printer-state-reasons for a registered printer. The
background status loop calls this on each registered printer and
updates the IPP attribute when the value changes. Returning None
means “no update” (keep whatever the registry already holds).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".