Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interfacing with USB devices in Rust?

Tags:

rust

I'm trying to figure out how to interface with a USB device in Rust. Does anyone have a solution? I found a package called usb-rust, but it was deprecated.

like image 590
Fluffy Avatar asked Oct 30 '22 06:10

Fluffy


1 Answers

There are a number of wrappers to the C libusb library, including libusb and usb I haven't used either yet, but since your question came up first in my search, I thought I'd log these two answers here.

Editing in 2022, neither libusb-rs, rust-usb have been updated to the current version of Rust, but as another answer points out, rusb is very much active, builds libusb as part of installation, and wraps resources so they automatically get closed via RAII. Nice!

like image 52
Dylan McNamee Avatar answered Jan 04 '23 13:01

Dylan McNamee