Crate usb_ids

source ·
Expand description

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.

Structs§

  • Represents a USB device class in the USB database.
  • An abstraction for iterating over all classes in the USB database.
  • Represents a single device in the USB database.
  • An abstraction for iterating over all HID usage pages in the USB database.
  • Represents an interface to a USB device in the USB database.
  • An abstraction for iterating over all languages in the USB database.
  • Represents a class subclass in the USB database. Subclasses are part of the USB class code triplet (base class, subclass, protocol).
  • Represents a generic USB ID in the USB database.
  • Represents a generic USB ID in the USB database with children IDs.
  • Represents a USB device vendor in the USB database.
  • An abstraction for iterating over all vendors in the USB database.

Traits§

  • A convenience trait for retrieving a top-level entity (like a Vendor) from the USB database by its unique ID.

Type Aliases§

  • Represents an audio terminal type in the USB database.
  • Represents physical descriptor bias type in the USB database.
  • Represents a language dialect in the USB database.
  • Represents a HID descriptor type in the USB database.
  • Represents a HID descriptor country code in the USB database.
  • Represents a HID descriptor item type in the USB database.
  • Represents a HID usage type in the USB database.
  • Represents a HID usage page in the USB database.
  • Represents a language type in the USB database.
  • Represents physical descriptor item type in the USB database.
  • Represents a subclass protocol in the USB database.
  • Represents a video class terminal type in the USB database.