#[non_exhaustive]pub enum SportControls {
Show 34 variants
BaseballBat,
GolfClub,
RowingMachine,
Treadmill,
Oar,
Slope,
Rate,
StickSpeed,
StickFaceAngle,
StickHeelToe,
StickFollowThrough,
StickTempo,
StickType,
StickHeight,
Putter,
OneIron,
TwoIron,
ThreeIron,
FourIron,
FiveIron,
SixIron,
SevenIron,
EightIron,
NineIron,
One0Iron,
One1Iron,
SandWedge,
LoftWedge,
PowerWedge,
OneWood,
ThreeWood,
FiveWood,
SevenWood,
NineWood,
}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
Usage ID 0x1: “Baseball Bat”
GolfClub
Usage ID 0x2: “Golf Club”
RowingMachine
Usage ID 0x3: “Rowing Machine”
Treadmill
Usage ID 0x4: “Treadmill”
Oar
Usage ID 0x30: “Oar”
Slope
Usage ID 0x31: “Slope”
Rate
Usage ID 0x32: “Rate”
StickSpeed
Usage ID 0x33: “Stick Speed”
StickFaceAngle
Usage ID 0x34: “Stick Face Angle”
StickHeelToe
Usage ID 0x35: “Stick Heel/Toe”
StickFollowThrough
Usage ID 0x36: “Stick Follow Through”
StickTempo
Usage ID 0x37: “Stick Tempo”
StickType
Usage ID 0x38: “Stick Type”
StickHeight
Usage ID 0x39: “Stick Height”
Putter
Usage ID 0x50: “Putter”
OneIron
Usage ID 0x51: “1 Iron”
TwoIron
Usage ID 0x52: “2 Iron”
ThreeIron
Usage ID 0x53: “3 Iron”
FourIron
Usage ID 0x54: “4 Iron”
FiveIron
Usage ID 0x55: “5 Iron”
SixIron
Usage ID 0x56: “6 Iron”
SevenIron
Usage ID 0x57: “7 Iron”
EightIron
Usage ID 0x58: “8 Iron”
NineIron
Usage ID 0x59: “9 Iron”
One0Iron
Usage ID 0x5A: “10 Iron”
One1Iron
Usage ID 0x5B: “11 Iron”
SandWedge
Usage ID 0x5C: “Sand Wedge”
LoftWedge
Usage ID 0x5D: “Loft Wedge”
PowerWedge
Usage ID 0x5E: “Power Wedge”
OneWood
Usage ID 0x5F: “1 Wood”
ThreeWood
Usage ID 0x60: “3 Wood”
FiveWood
Usage ID 0x61: “5 Wood”
SevenWood
Usage ID 0x62: “7 Wood”
NineWood
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 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().