xinput/structures/
battery_information.rs

1use crate::*;
2use bytemuck::{Pod, Zeroable};
3
4
5
6/// \[[microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/XInput/ns-xinput-xinput_battery_information)\]
7/// XINPUT_BATTERY_INFORMATION
8///
9/// Battery type and charge.
10#[derive(Clone, Copy, Debug)]
11#[derive(Default, Pod, Zeroable)]
12#[repr(C)] pub struct BatteryInformation {
13    /// The type of battery.
14    pub battery_type:   BatteryType,
15
16    /// The charge state of the battery.
17    /// This value is only valid for wireless devices with a known battery type.
18    pub battery_level:  BatteryLevel,
19}
20
21impl AsRef<Self> for BatteryInformation { fn as_ref(&    self) -> &    Self { self } }
22impl AsMut<Self> for BatteryInformation { fn as_mut(&mut self) -> &mut Self { self } }
23
24#[test] fn test_traits_for_coverage() {
25    let _info = BatteryInformation::default();
26    let _info = BatteryInformation::zeroed();
27    let _info = _info.clone();
28    dbg!(_info);
29}
30
31//#cpp2rust XINPUT_BATTERY_INFORMATION  = xinput::BatteryInformation