21 releases (11 stable)

2022.12.24 Dec 25, 2022
1.2024.2 Jan 31, 2024
1.2023.7 Nov 19, 2023
1.2023.2 Apr 30, 2023
0.0.2 Dec 27, 2020

#68 in Hardware support

Download history 55/week @ 2023-12-18 14/week @ 2023-12-25 10/week @ 2024-01-01 127/week @ 2024-01-08 81/week @ 2024-01-15 26/week @ 2024-01-22 30/week @ 2024-01-29 287/week @ 2024-02-05 43/week @ 2024-02-12 46/week @ 2024-02-19 138/week @ 2024-02-26 205/week @ 2024-03-04 109/week @ 2024-03-11 164/week @ 2024-03-18 199/week @ 2024-03-25 1040/week @ 2024-04-01

1,522 downloads per month
Used in 8 crates (7 directly)

MIT license

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