#[non_exhaustive]#[repr(u16)]pub enum SportControls {
Show 34 variants
BaseballBat = 1,
GolfClub = 2,
RowingMachine = 3,
Treadmill = 4,
Oar = 48,
Slope = 49,
Rate = 50,
StickSpeed = 51,
StickFaceAngle = 52,
StickHeelToe = 53,
StickFollowThrough = 54,
StickTempo = 55,
StickType = 56,
StickHeight = 57,
Putter = 80,
OneIron = 81,
TwoIron = 82,
ThreeIron = 83,
FourIron = 84,
FiveIron = 85,
SixIron = 86,
SevenIron = 87,
EightIron = 88,
NineIron = 89,
One0Iron = 90,
One1Iron = 91,
SandWedge = 92,
LoftWedge = 93,
PowerWedge = 94,
OneWood = 95,
ThreeWood = 96,
FiveWood = 97,
SevenWood = 98,
NineWood = 99,
}Expand description
Usage Page 0x4: “Sport Controls”
This enum is autogenerated from the HID Usage Tables.
let u1 = Usage::SportControls(SportControls::GolfClub);
let u2 = Usage::new_from_page_and_id(0x4, 0x2).unwrap();
let u3 = Usage::from(SportControls::GolfClub);
let u4: Usage = SportControls::GolfClub.into();
assert_eq!(u1, u2);
assert_eq!(u1, u3);
assert_eq!(u1, u4);
assert!(matches!(u1.usage_page(), UsagePage::SportControls));
assert_eq!(0x4, u1.usage_page_value());
assert_eq!(0x2, u1.usage_id_value());
assert_eq!((0x4 << 16) | 0x2, u1.usage_value());
assert_eq!("Golf Club", u1.name());Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BaseballBat = 1
Usage ID 0x1: “Baseball Bat”
GolfClub = 2
Usage ID 0x2: “Golf Club”
RowingMachine = 3
Usage ID 0x3: “Rowing Machine”
Treadmill = 4
Usage ID 0x4: “Treadmill”
Oar = 48
Usage ID 0x30: “Oar”
Slope = 49
Usage ID 0x31: “Slope”
Rate = 50
Usage ID 0x32: “Rate”
StickSpeed = 51
Usage ID 0x33: “Stick Speed”
StickFaceAngle = 52
Usage ID 0x34: “Stick Face Angle”
StickHeelToe = 53
Usage ID 0x35: “Stick Heel/Toe”
StickFollowThrough = 54
Usage ID 0x36: “Stick Follow Through”
StickTempo = 55
Usage ID 0x37: “Stick Tempo”
StickType = 56
Usage ID 0x38: “Stick Type”
StickHeight = 57
Usage ID 0x39: “Stick Height”
Putter = 80
Usage ID 0x50: “Putter”
OneIron = 81
Usage ID 0x51: “1 Iron”
TwoIron = 82
Usage ID 0x52: “2 Iron”
ThreeIron = 83
Usage ID 0x53: “3 Iron”
FourIron = 84
Usage ID 0x54: “4 Iron”
FiveIron = 85
Usage ID 0x55: “5 Iron”
SixIron = 86
Usage ID 0x56: “6 Iron”
SevenIron = 87
Usage ID 0x57: “7 Iron”
EightIron = 88
Usage ID 0x58: “8 Iron”
NineIron = 89
Usage ID 0x59: “9 Iron”
One0Iron = 90
Usage ID 0x5A: “10 Iron”
One1Iron = 91
Usage ID 0x5B: “11 Iron”
SandWedge = 92
Usage ID 0x5C: “Sand Wedge”
LoftWedge = 93
Usage ID 0x5D: “Loft Wedge”
PowerWedge = 94
Usage ID 0x5E: “Power Wedge”
OneWood = 95
Usage ID 0x5F: “1 Wood”
ThreeWood = 96
Usage ID 0x60: “3 Wood”
FiveWood = 97
Usage ID 0x61: “5 Wood”
SevenWood = 98
Usage ID 0x62: “7 Wood”
NineWood = 99
Usage ID 0x63: “9 Wood”
Implementations§
Trait Implementations§
Source§impl AsUsage for SportControls
impl AsUsage for SportControls
Source§fn usage_value(&self) -> u32
fn usage_value(&self) -> u32
Returns the 32 bit Usage value of this Usage
Source§fn usage_id_value(&self) -> u16
fn usage_id_value(&self) -> u16
Returns the 16 bit Usage ID value of this Usage
Source§fn usage(&self) -> Usage
fn usage(&self) -> Usage
Returns this usage as Usage::SportControls(self)
This is a convenience function to avoid having
to implement From for every used type in the caller.
let gd_x = GenericDesktop::X;
let usage = Usage::from(GenericDesktop::X);
assert!(matches!(gd_x.usage(), usage));Source§impl AsUsagePage for SportControls
impl AsUsagePage for SportControls
Source§fn usage_page_value(&self) -> u16
fn usage_page_value(&self) -> u16
Returns the 16 bit value of this UsagePage
This value is 0x4 for SportControls
Source§fn usage_page(&self) -> UsagePage
fn usage_page(&self) -> UsagePage
Returns UsagePage::SportControls]
Source§impl BitOr<u16> for SportControls
impl BitOr<u16> for SportControls
Source§impl Clone for SportControls
impl Clone for SportControls
Source§fn clone(&self) -> SportControls
fn clone(&self) -> SportControls
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SportControls
impl Debug for SportControls
Source§impl Display for SportControls
Available on crate feature std only.
impl Display for SportControls
std only.Source§impl From<&SportControls> for Usage
impl From<&SportControls> for Usage
Source§fn from(sportcontrols: &SportControls) -> Usage
fn from(sportcontrols: &SportControls) -> Usage
Source§impl From<&SportControls> for UsagePage
impl From<&SportControls> for UsagePage
Source§fn from(_: &SportControls) -> UsagePage
fn from(_: &SportControls) -> UsagePage
Always returns UsagePage::SportControls and is identical to SportControls::usage_page().
Source§impl From<&SportControls> for u16
impl From<&SportControls> for u16
Source§fn from(sportcontrols: &SportControls) -> u16
fn from(sportcontrols: &SportControls) -> u16
Source§impl From<&SportControls> for u32
impl From<&SportControls> for u32
Source§fn from(sportcontrols: &SportControls) -> u32
fn from(sportcontrols: &SportControls) -> u32
Returns the 32 bit value of this usage. This is identical to SportControls::usage_value().
Source§impl From<SportControls> for Usage
impl From<SportControls> for Usage
Source§fn from(sportcontrols: SportControls) -> Usage
fn from(sportcontrols: SportControls) -> Usage
Source§impl From<SportControls> for UsagePage
impl From<SportControls> for UsagePage
Source§fn from(_: SportControls) -> UsagePage
fn from(_: SportControls) -> UsagePage
Always returns UsagePage::SportControls and is identical to SportControls::usage_page().
Source§impl From<SportControls> for u16
impl From<SportControls> for u16
Source§fn from(sportcontrols: SportControls) -> u16
fn from(sportcontrols: SportControls) -> u16
Returns the 16bit value of this usage. This is identical to SportControls::usage_page_value().