nusb/examples
Kevin Mehall 14a8f171e5
Make blocking APIs optionally async (#100)
* Make blocking APIs optionally async

`DeviceInfo::open`, `Device::from_fd`, `Device::set_configuration`,
`Device::reset`, `Interface::set_alt_setting`, `Interface::clear_halt`
all perform IO but are currently blocking because the underlying OS APIs
are blocking.

`list_devices`,`list_buses`, `Device::claim_interface`
`Device::detach_and_claim_interface` theoretically don't perform IO, but
are also included here because they need to be async on WebUSB.

The `MaybeFuture` trait allows deferring these actions to the thread pool
from the `blocking` crate when used asynchronously with `.await` /
`IntoFuture`, or directly runs the blocking syscall synchronously with a
`.wait()` method.
2025-02-11 18:53:07 -07:00
..
blocking.rs Make blocking APIs optionally async (#100) 2025-02-11 18:53:07 -07:00
bulk.rs Make blocking APIs optionally async (#100) 2025-02-11 18:53:07 -07:00
buses.rs Make blocking APIs optionally async (#100) 2025-02-11 18:53:07 -07:00
control.rs Make blocking APIs optionally async (#100) 2025-02-11 18:53:07 -07:00
descriptors.rs Make blocking APIs optionally async (#100) 2025-02-11 18:53:07 -07:00
detach.rs Make blocking APIs optionally async (#100) 2025-02-11 18:53:07 -07:00
detach_claim.rs Make blocking APIs optionally async (#100) 2025-02-11 18:53:07 -07:00
hotplug.rs windows: Hotplug 2024-07-28 14:45:03 -06:00
list.rs Make blocking APIs optionally async (#100) 2025-02-11 18:53:07 -07:00
string_descriptors.rs Make blocking APIs optionally async (#100) 2025-02-11 18:53:07 -07:00