pub enum DeviceSelector {
VidPid {
vid: u16,
pid: u16,
},
First(Box<dyn Fn(&Device) -> bool>),
Specific(Device),
}Expand description
Strategy for selecting which USB device to install a driver for.
Variants§
VidPid
Select a device by USB Vendor ID and Product ID.
If multiple devices match, the first one found will be used.
First(Box<dyn Fn(&Device) -> bool>)
Select the first device matching a predicate function.
The predicate receives a reference to each device and returns true
if it should be selected.
Specific(Device)
Use a specific device that was previously enumerated.
This is useful when you’ve already called create_list and want
to install a driver for a specific device from that list.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DeviceSelector
impl !RefUnwindSafe for DeviceSelector
impl !Send for DeviceSelector
impl !Sync for DeviceSelector
impl Unpin for DeviceSelector
impl !UnwindSafe for DeviceSelector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more