#hid #ids #cg

usb-ids

Rust wrappers for the USB ID Repository

19 releases (9 stable)

2022.12.24 Dec 25, 2022
1.2023.7 Nov 19, 2023
1.2023.6 Oct 18, 2023
1.2023.2 Apr 30, 2023
0.0.2 Dec 27, 2020

#75 in Hardware support

Download history 122/week @ 2023-08-15 134/week @ 2023-08-22 77/week @ 2023-08-29 187/week @ 2023-09-05 283/week @ 2023-09-12 357/week @ 2023-09-19 554/week @ 2023-09-26 509/week @ 2023-10-03 144/week @ 2023-10-10 164/week @ 2023-10-17 290/week @ 2023-10-24 165/week @ 2023-10-31 215/week @ 2023-11-07 181/week @ 2023-11-14 217/week @ 2023-11-21 133/week @ 2023-11-28

779 downloads per month
Used in 6 crates

MIT license

265KB
964 lines

usb-ids

CI Crates.io

Cross-platform Rust wrappers for the USB ID Repository.

This library bundles the USB ID database, allowing platforms other than Linux to query it as a source of canonical USB metadata.

Usage

Iterating over all known vendors:

use usb_ids::Vendors;

for vendor in Vendors::iter() {
    for device in vendor.devices() {
        println!("vendor: {}, device: {}", vendor.name(), device.name());
    }
}

See the documentation for more details.


lib.rs:

Rust wrappers for the USB ID Repository.

The USB ID Repository is the canonical source of USB device information for most Linux userspaces; this crate vendors the USB ID database to allow non-Linux hosts to access the same canonical information.

Usage

Iterating over all known vendors:

use usb_ids::Vendors;

for vendor in Vendors::iter() {
    for device in vendor.devices() {
        println!("vendor: {}, device: {}", vendor.name(), device.name());
    }
}

Iterating over all known classes:

use usb_ids::Classes;

for class in Classes::iter() {
    println!("class: {}", class.name());
    for subclass in class.sub_classes() {
        println!("\tsubclass: {}", subclass.name());
        for protocol in subclass.protocols() {
           println!("\t\tprotocol: {}", protocol.name());
        }
    }
}

See the individual documentation for each structure for more details.

Dependencies