1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
#![cfg_attr(not(test), no_std)]
#![deny(missing_docs)]
#![doc = include_str!("../README.md")]
mod tables;
#[cfg(feature = "non-authorative")]
pub mod non_authorative;
pub use tables::*;
/// Generic type for the subclasses of device classes.
///
/// This is a new type arround `u16`, no validity checking is performed.
///
/// If you are using a well known device class, you may want to use one of the well-known subclass enums.
#[cfg_attr(feature = "fixed-repr", repr(transparent))]
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
pub struct SubclassId(u16);
impl SubclassId {
/// Obtains the appropriate [`SubclassId`] from the given numeric id.
pub const fn from_id(x: u16) -> Self {
Self(x)
}
/// Converts the [`SubclassId`] to the appropriate numeric id
pub const fn id(self) -> u16 {
self.0
}
}
/// Generic type for the products of registered vendors
///
/// This is a new type arround `u16`, no validity checking is performed.
#[cfg_attr(feature = "fixed-repr", repr(transparent))]
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
pub struct ProductId(u16);
impl ProductId {
/// Obtains the appropriate [`ProductId`] from the given numeric id.
pub const fn from_id(x: u16) -> Self {
Self(x)
}
/// Converts the [`ProductId`] to the appropriate numeric id
pub const fn id(self) -> u16 {
self.0
}
}