usbapi 0.4.2

Access USB from Rust
Documentation
1
2
3
4
5
6
7
8
use serde_json;
use toml;
use usbapi::UsbEnumerate;
fn main() {
    let mut usb = UsbEnumerate::from_sysfs().expect("Could not find /dev/bus/usb are you running windows or maybe freebsd or mac or... whatever feel free to add a patch :)");
    println!("{}", toml::to_string_pretty(usb.devices()).unwrap());
    println!("{}", serde_json::to_string_pretty(usb.devices()).unwrap());
}