pub enum DeviceKind {
Mouse,
Keyboard,
Numpad,
Presenter,
Remote,
Trackball,
Touchpad,
Tablet,
Gamepad,
Joystick,
Headset,
Unknown,
}Expand description
What a paired peripheral is. Mirrors hidpp::receiver::bolt::BoltDeviceKind
but is owned by us so consumers don’t depend on hidpp.
Several upstream “device type” vocabularies feed this one enum, and they do
not agree on numbers: the Bolt pairing register uses Unknown=0, Keyboard=1, Mouse=2, …, while the HID++ 0x0005 feature uses
Keyboard=0, …, Mouse=3, … (no Unknown at all). The asset registry adds a
third, free-form string type ("mouse", case-inconsistently "MOUSE").
They are converted to this enum at their respective boundaries — never by
reinterpreting one source’s raw byte with another’s table — so the numeric
mismatch can’t leak past those mappers.
Variants§
Implementations§
Source§impl DeviceKind
impl DeviceKind
Sourcepub fn from_registry_type(raw: &str) -> Self
pub fn from_registry_type(raw: &str) -> Self
Parse the OpenLogi asset registry’s type string into a DeviceKind.
The registry field is free-form and case-inconsistent (both "mouse"
and "MOUSE" ship), so we case-fold before matching. Values we don’t
model map to DeviceKind::Unknown, which callers treat as “no asset
opinion” and fall back to the HID++ classification.
Trait Implementations§
Source§impl Clone for DeviceKind
impl Clone for DeviceKind
Source§fn clone(&self) -> DeviceKind
fn clone(&self) -> DeviceKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DeviceKind
Source§impl Debug for DeviceKind
impl Debug for DeviceKind
Source§impl<'de> Deserialize<'de> for DeviceKind
impl<'de> Deserialize<'de> for DeviceKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for DeviceKind
Source§impl Hash for DeviceKind
impl Hash for DeviceKind
Source§impl PartialEq for DeviceKind
impl PartialEq for DeviceKind
Source§fn eq(&self, other: &DeviceKind) -> bool
fn eq(&self, other: &DeviceKind) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for DeviceKind
impl Serialize for DeviceKind
impl StructuralPartialEq for DeviceKind
Auto Trait Implementations§
impl Freeze for DeviceKind
impl RefUnwindSafe for DeviceKind
impl Send for DeviceKind
impl Sync for DeviceKind
impl Unpin for DeviceKind
impl UnsafeUnpin for DeviceKind
impl UnwindSafe for DeviceKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.