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§
- Class
- Represents a USB device class in the USB database.
- Classes
- An abstraction for iterating over all classes in the USB database.
- Device
- Represents a single device in the USB database.
- HidUsage
Pages - An abstraction for iterating over all HID usage pages in the USB database.
- Interface
- Represents an interface to a USB device in the USB database.
- Languages
- An abstraction for iterating over all languages in the USB database.
- SubClass
- Represents a class subclass in the USB database. Subclasses are part of the USB class code triplet (base class, subclass, protocol).
- UsbId
- Represents a generic USB ID in the USB database.
- UsbId
With Children - Represents a generic USB ID in the USB database with children IDs.
- Vendor
- Represents a USB device vendor in the USB database.
- Vendors
- An abstraction for iterating over all vendors in the USB database.
Traits§
- FromId
- A convenience trait for retrieving a top-level entity (like a
Vendor
) from the USB database by its unique ID.
Type Aliases§
- Audio
Terminal - Represents an audio terminal type in the USB database.
- Bias
- Represents physical descriptor bias type in the USB database.
- Dialect
- Represents a language dialect in the USB database.
- Hid
- Represents a HID descriptor type in the USB database.
- HidCountry
Code - Represents a HID descriptor country code in the USB database.
- HidItem
Type - Represents a HID descriptor item type in the USB database.
- HidUsage
- Represents a HID usage type in the USB database.
- HidUsage
Page - Represents a HID usage page in the USB database.
- Language
- Represents a language type in the USB database.
- Phy
- Represents physical descriptor item type in the USB database.
- Protocol
- Represents a subclass protocol in the USB database.
- Video
Terminal - Represents a video class terminal type in the USB database.