Type Alias usb_ids::HidUsagePage

source ·
pub type HidUsagePage = UsbIdWithChildren<u8, HidUsage>;
Expand description

Represents a HID usage page in the USB database.

Every HID usage page has a usage page ID, a pretty name, and a list of associated HidUsages.

use usb_ids::{HidUsagePage, FromId};
let hid_usage_page = HidUsagePage::from_id(0x01).unwrap();
assert_eq!(hid_usage_page.name(), "Generic Desktop Controls");

for usage in hid_usage_page.usages() {
  println!("usage: {}", usage.name());
}

Aliased Type§

struct HidUsagePage { /* private fields */ }

Implementations§

source§

impl HidUsagePage

source

pub fn usages(&self) -> impl Iterator<Item = &'static HidUsage>

Returns an iterator over the page’s HidUsages.

Trait Implementations§

source§

impl FromId<u8> for HidUsagePage

source§

fn from_id(id: u8) -> Option<&'static Self>

Returns the entity corresponding to id, or None if none exists.