26 releases (16 stable)

2022.12.24 Dec 25, 2022
1.2025.2 Apr 2, 2025
1.2025.1 Jan 15, 2025
1.2024.5 Dec 9, 2024
0.0.2 Dec 27, 2020

#59 in Hardware support

Download history 164/week @ 2024-12-21 127/week @ 2024-12-28 235/week @ 2025-01-04 452/week @ 2025-01-11 421/week @ 2025-01-18 1225/week @ 2025-01-25 1171/week @ 2025-02-01 748/week @ 2025-02-08 1074/week @ 2025-02-15 508/week @ 2025-02-22 590/week @ 2025-03-01 549/week @ 2025-03-08 1155/week @ 2025-03-15 615/week @ 2025-03-22 1287/week @ 2025-03-29 1021/week @ 2025-04-05

4,127 downloads per month
Used in 12 crates (10 directly)

MIT license

270KB
958 lines

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.


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.

Dependencies