xinput/enumerations/
battery_level.rs1use bytemuck::{Pod, Zeroable};
2use winapi::um::xinput::*;
3
4
5
6#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
9#[derive(Pod, Zeroable)]
10#[repr(transparent)] pub struct BatteryLevel(u8);
11
12enumish! { BatteryLevel => u8; default: Empty == 0; Empty, Low, Medium, Full }
13
14#[allow(non_upper_case_globals)] #[allow(missing_docs)] impl BatteryLevel {
15 pub const Empty : BatteryLevel = BatteryLevel(BATTERY_LEVEL_EMPTY as _);
16 pub const Low : BatteryLevel = BatteryLevel(BATTERY_LEVEL_LOW as _);
17 pub const Medium : BatteryLevel = BatteryLevel(BATTERY_LEVEL_MEDIUM as _);
18 pub const Full : BatteryLevel = BatteryLevel(BATTERY_LEVEL_FULL as _);
19}
20
21