24 releases (14 stable)

2022.12.24 Dec 25, 2022
1.2024.5 Dec 9, 2024
1.2024.4 Jul 8, 2024
1.2024.2 Jan 31, 2024
0.0.2 Dec 27, 2020

#37 in Hardware support

Download history 464/week @ 2024-09-18 418/week @ 2024-09-25 406/week @ 2024-10-02 538/week @ 2024-10-09 496/week @ 2024-10-16 431/week @ 2024-10-23 521/week @ 2024-10-30 198/week @ 2024-11-06 318/week @ 2024-11-13 322/week @ 2024-11-20 408/week @ 2024-11-27 547/week @ 2024-12-04 500/week @ 2024-12-11 357/week @ 2024-12-18 154/week @ 2024-12-25 154/week @ 2025-01-01

1,294 downloads per month
Used in 12 crates (10 directly)

MIT license

270KB
958 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