Arcade

Enum Arcade 

Source
#[non_exhaustive]
pub enum Arcade {
Show 27 variants GeneralPurposeIOCard, CoinDoor, WatchdogTimer, GeneralPurposeAnalogInputState, GeneralPurposeDigitalInputState, GeneralPurposeOpticalInputState, GeneralPurposeDigitalOutputState, NumberofCoinDoors, CoinDrawerDropCount, CoinDrawerStart, CoinDrawerService, CoinDrawerTilt, CoinDoorTest, CoinDoorLockout, WatchdogTimeout, WatchdogAction, WatchdogReboot, WatchdogRestart, AlarmInput, CoinDoorCounter, IODirectionMapping, SetIODirectionMapping, ExtendedOpticalInputState, PinPadInputState, PinPadStatus, PinPadOutput, PinPadCommand,
}
Expand description

Usage Page 0x91: “Arcade”

This enum is autogenerated from the HID Usage Tables.

let u1 = Usage::Arcade(Arcade::CoinDoor);
let u2 = Usage::new_from_page_and_id(0x91, 0x2).unwrap();
let u3 = Usage::from(Arcade::CoinDoor);
let u4: Usage = Arcade::CoinDoor.into();
assert_eq!(u1, u2);
assert_eq!(u1, u3);
assert_eq!(u1, u4);

assert!(matches!(u1.usage_page(), UsagePage::Arcade));
assert_eq!(0x91, u1.usage_page_value());
assert_eq!(0x2, u1.usage_id_value());
assert_eq!((0x91 << 16) | 0x2, u1.usage_value());
assert_eq!("Coin Door", u1.name());

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

GeneralPurposeIOCard

Usage ID 0x1: “General Purpose IO Card”

§

CoinDoor

Usage ID 0x2: “Coin Door”

§

WatchdogTimer

Usage ID 0x3: “Watchdog Timer”

§

GeneralPurposeAnalogInputState

Usage ID 0x30: “General Purpose Analog Input State”

§

GeneralPurposeDigitalInputState

Usage ID 0x31: “General Purpose Digital Input State”

§

GeneralPurposeOpticalInputState

Usage ID 0x32: “General Purpose Optical Input State”

§

GeneralPurposeDigitalOutputState

Usage ID 0x33: “General Purpose Digital Output State”

§

NumberofCoinDoors

Usage ID 0x34: “Number of Coin Doors”

§

CoinDrawerDropCount

Usage ID 0x35: “Coin Drawer Drop Count”

§

CoinDrawerStart

Usage ID 0x36: “Coin Drawer Start”

§

CoinDrawerService

Usage ID 0x37: “Coin Drawer Service”

§

CoinDrawerTilt

Usage ID 0x38: “Coin Drawer Tilt”

§

CoinDoorTest

Usage ID 0x39: “Coin Door Test”

§

CoinDoorLockout

Usage ID 0x40: “Coin Door Lockout”

§

WatchdogTimeout

Usage ID 0x41: “Watchdog Timeout”

§

WatchdogAction

Usage ID 0x42: “Watchdog Action”

§

WatchdogReboot

Usage ID 0x43: “Watchdog Reboot”

§

WatchdogRestart

Usage ID 0x44: “Watchdog Restart”

§

AlarmInput

Usage ID 0x45: “Alarm Input”

§

CoinDoorCounter

Usage ID 0x46: “Coin Door Counter”

§

IODirectionMapping

Usage ID 0x47: “I/O Direction Mapping”

§

SetIODirectionMapping

Usage ID 0x48: “Set I/O Direction Mapping”

§

ExtendedOpticalInputState

Usage ID 0x49: “Extended Optical Input State”

§

PinPadInputState

Usage ID 0x4A: “Pin Pad Input State”

§

PinPadStatus

Usage ID 0x4B: “Pin Pad Status”

§

PinPadOutput

Usage ID 0x4C: “Pin Pad Output”

§

PinPadCommand

Usage ID 0x4D: “Pin Pad Command”

Implementations§

Source§

impl Arcade

Source

pub fn name(&self) -> String

Trait Implementations§

Source§

impl AsUsage for Arcade

Source§

fn usage_value(&self) -> u32

Returns the 32 bit Usage value of this Usage

Source§

fn usage_id_value(&self) -> u16

Returns the 16 bit Usage ID value of this Usage

Source§

fn usage(&self) -> Usage

Returns this usage as Usage::Arcade(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 Arcade

Source§

fn usage_page_value(&self) -> u16

Returns the 16 bit value of this UsagePage

This value is 0x91 for Arcade

Source§

fn usage_page(&self) -> UsagePage

Source§

impl BitOr<u16> for Arcade

Source§

fn bitor(self, usage: u16) -> Usage

A convenience function to combine a Usage Page with a value.

This function panics if the Usage ID value results in an unknown Usage. Where error checking is required, use UsagePage::to_usage_from_value.

Source§

type Output = Usage

The resulting type after applying the | operator.
Source§

impl Debug for Arcade

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Arcade

Available on crate feature std only.
Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&Arcade> for Usage

Source§

fn from(arcade: &Arcade) -> Usage

Converts to this type from the input type.
Source§

impl From<&Arcade> for UsagePage

Source§

fn from(_: &Arcade) -> UsagePage

Always returns UsagePage::Arcade and is identical to Arcade::usage_page().

Source§

impl From<&Arcade> for u16

Source§

fn from(arcade: &Arcade) -> u16

Converts to this type from the input type.
Source§

impl From<&Arcade> for u32

Source§

fn from(arcade: &Arcade) -> u32

Returns the 32 bit value of this usage. This is identical to Arcade::usage_value().

Source§

impl From<Arcade> for Usage

Source§

fn from(arcade: Arcade) -> Usage

Converts to this type from the input type.
Source§

impl From<Arcade> for UsagePage

Source§

fn from(_: Arcade) -> UsagePage

Always returns UsagePage::Arcade and is identical to Arcade::usage_page().

Source§

impl From<Arcade> for u16

Source§

fn from(arcade: Arcade) -> u16

Returns the 16bit value of this usage. This is identical to Arcade::usage_page_value().

Source§

impl TryFrom<u16> for Arcade

Source§

type Error = HutError

The type returned in the event of a conversion error.
Source§

fn try_from(usage_id: u16) -> Result<Arcade, HutError>

Performs the conversion.

Auto Trait Implementations§

§

impl Freeze for Arcade

§

impl RefUnwindSafe for Arcade

§

impl Send for Arcade

§

impl Sync for Arcade

§

impl Unpin for Arcade

§

impl UnwindSafe for Arcade

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> ToString for T
where T: Display + ?Sized,

§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.