No description
Find a file
Kevin Mehall bcfb2b8e89 Take waker and drop EndpointInner reference before waking transfer
This fixes a race condition for users that drop the Endpoint immediately after a transfer
completes, and then might immediately try and re-open the endpoint. The event thread
still held an Arc reference after marking the transfer complete, and so the endpoint
was still considered in use and re-opening occasionally failed.

It also means the `Notify` lock is not held when calling the waker function, which fixes
a deadlock if it were to call back into endpoint methods.
2025-10-04 14:52:35 -06:00
.github/workflows cargo features for smol and tokio blocking executors 2025-04-12 13:29:17 -06:00
examples EndpointRead / EndpointWrite examples with tokio and smol 2025-07-16 21:47:22 -06:00
fuzz impl Debug for descriptors 2023-12-16 23:05:03 -07:00
src Take waker and drop EndpointInner reference before waking transfer 2025-10-04 14:52:35 -06:00
.gitignore Initial commit: bulk transfers on Linux usbfs 2023-09-30 16:51:13 -06:00
Cargo.toml v0.2.0 2025-07-27 13:00:28 -06:00
LICENSE-APACHE A little bit of documentation 2023-10-01 12:20:30 -06:00
LICENSE-MIT A little bit of documentation 2023-10-01 12:20:30 -06:00
README.md Documentation improvements 2025-07-26 17:21:28 -06:00

nusb

A new pure-Rust library for cross-platform low-level access to USB devices.

nusb supports Windows, macOS, and Linux, and provides both async and blocking APIs for listing and watching USB devices, reading descriptor details, opening and managing devices and interfaces, and performing transfers on control, bulk, and interrupt endpoints.

Compared to rusb and libusb

  • Pure Rust, no dependency on libusb or any other C library.
  • Async-first, while not requiring an async runtime.
  • No context object. You just open a device. There is a global event loop thread that is started when opening the first device.
  • Thinner layer over OS APIs, with less internal state.

License

MIT or Apache 2.0, at your option