xinput/enumerations/
battery_type.rs1#![allow(deprecated)]
2use bytemuck::{Pod, Zeroable};
3use winapi::um::xinput::*;
4
5
6
7#[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 pub const Disconnected : BatteryType = BatteryType(BATTERY_TYPE_DISCONNECTED as _); pub const Wired : BatteryType = BatteryType(BATTERY_TYPE_WIRED as _);
21
22 pub const Alkaline : BatteryType = BatteryType(BATTERY_TYPE_ALKALINE as _);
24
25 pub const NiMH : BatteryType = BatteryType(BATTERY_TYPE_NIMH as _);
27
28 #[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 _); }
32
33