First, excellent program. Thank you! It works like a dream on my Windows 10 machine, which has allowed me to work around the issues.
I was able to complete the build by changing
pub trait UsbCallback {
to
pub trait UsbCallback: Send {
And by updating the rusb dependency to version ^0.9.1 from ^0.7.1.
The build failed with
error[E0277]: `(dyn UsbCallback + 'static)` cannot be sent between threads safely
--> src/platform/pnp_detect_libusb.rs:16:21
|
16 | impl<T: UsbContext> rusb::Hotplug<T> for PnPDetectLibusb {
| ^^^^^^^^^^^^^^^^ `(dyn UsbCallback + 'static)` cannot be sent between threads safely
|
::: /home/UID/.local/.cargo/registry/src/github.com-1ecc6299db9ec823/rusb-0.9.1/src/hotplug.rs:28:35
|
28 | pub trait Hotplug<T: UsbContext>: Send {
| ---- required by this bound in `Hotplug`
|
= help: the trait `Send` is not implemented for `(dyn UsbCallback + 'static)`
= note: required because of the requirements on the impl of `Send` for `Unique<(dyn UsbCallback + 'static)>`
= note: required because it appears within the type `Box<(dyn UsbCallback + 'static)>`
note: required because it appears within the type `PnPDetectLibusb`
--> src/platform/pnp_detect_libusb.rs:12:12
|
12 | pub struct PnPDetectLibusb {
| ^^^^
First, excellent program. Thank you! It works like a dream on my Windows 10 machine, which has allowed me to work around the issues.
I was able to complete the build by changing
to
And by updating the rusb dependency to version ^0.9.1 from ^0.7.1.
The build failed with