xinput/enumerations/
battery_type.rs

1#![allow(deprecated)]
2use bytemuck::{Pod, Zeroable};
3use winapi::um::xinput::*;
4
5
6
7/// \[[microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/XInput/ns-xinput-xinput_battery_information)\]
8/// BATTERY_TYPE_\*
9#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
10#[derive(Pod, Zeroable)]
11#[repr(transparent)] pub struct BatteryType(u8);
12
13enumish! { BatteryType => u8; default: Disconnected == 0; Disconnected, Wired, Alkaline, NiMH, Unknown }
14
15#[allow(non_upper_case_globals)] impl BatteryType {
16    /// The device is not connected.
17    pub const Disconnected : BatteryType = BatteryType(BATTERY_TYPE_DISCONNECTED as _); // 0
18
19    /// The device is a wired device, and does not have a battery.
20    pub const Wired : BatteryType = BatteryType(BATTERY_TYPE_WIRED as _);
21
22    /// The device has an alkaline battery.
23    pub const Alkaline : BatteryType = BatteryType(BATTERY_TYPE_ALKALINE as _);
24
25    /// The device has a **ni**ckle **m**etal **h**ydride battery.
26    pub const NiMH : BatteryType = BatteryType(BATTERY_TYPE_NIMH as _);
27
28    /// The device has an unknown battery type.
29    #[deprecated = "Are you sure you want to use this?  New BATTERY_TYPE_* enumerations may be added at a later date..."]
30    pub const Unknown : BatteryType = BatteryType(BATTERY_TYPE_UNKNOWN as _); // 255
31}
32
33//#cpp2rust BATTERY_TYPE_DISCONNECTED   = xinput::BatteryType::Disconnected
34//#cpp2rust BATTERY_TYPE_WIRED          = xinput::BatteryType::Wired
35//#cpp2rust BATTERY_TYPE_ALKALINE       = xinput::BatteryType::Alkaline
36//#cpp2rust BATTERY_TYPE_NIMH           = xinput::BatteryType::NiMH
37//#cpp2rust BATTERY_TYPE_UNKNOWN        = xinput::BatteryType::Unknown