Skip to main content

DeviceSource

Trait DeviceSource 

Source
pub trait DeviceSource: Send + Sync {
    // Required method
    fn opener(&self, ident: &DeviceIdent) -> Arc<dyn DeviceOpener> ⓘ;
}
Expand description

Where the supervisor gets devices from.

Production returns a UsbOpener matched to the device’s serial; tests return an opener for a virtual device.

Required Methods§

Source

fn opener(&self, ident: &DeviceIdent) -> Arc<dyn DeviceOpener> ⓘ

The opener for a device the watch reported. It’s used to open the device now and, if the mount ever needs it, to reopen the same one later, so it must resolve to that device and not to “whatever is plugged in”.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§