Trait rusb::Hotplug

source ·
pub trait Hotplug<T: UsbContext>: Send {
    // Required methods
    fn device_arrived(&mut self, device: Device<T>);
    fn device_left(&mut self, device: Device<T>);
}
Expand description

When handling a Hotplug::device_arrived event it is considered safe to call any rusb function that takes a Device. It also safe to open a device and submit asynchronous transfers. However, most other functions that take a DeviceHandle are not safe to call. Examples of such functions are any of the synchronous API functions or the blocking functions that retrieve various USB descriptors. These functions must be used outside of the context of the Hotplug functions.

Required Methods§

source

fn device_arrived(&mut self, device: Device<T>)

source

fn device_left(&mut self, device: Device<T>)

Implementors§