xinput/structures/
capabilities.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_capabilities)\]
7/// XINPUT_CAPABILITIES
8///
9/// Battery type and charge.
10#[derive(Clone, Copy, Debug)]
11#[derive(Pod, Zeroable)]
12#[repr(C)] pub struct Capabilities {
13    /// Device type (generally always [DevType::Gamepad]?)
14    pub ty:         DevType,
15
16    /// Device "sub"type.
17    ///
18    /// **NOTE:** "Legacy" XInput (9.1.0 / Windows Vista) will always return [`DevSubType::Gamepad`], regardless of device.
19    pub sub_type:   DevSubType,
20
21    /// Capability flags.
22    pub flags:      Caps,
23
24    /// Describes available features and control resolutions.
25    pub gamepad:    Gamepad,
26
27    /// Describes available functionality and resolutions.
28    pub vibration:  Vibration,
29}
30
31impl AsRef<Self> for Capabilities { fn as_ref(&    self) -> &    Self { self } }
32impl AsMut<Self> for Capabilities { fn as_mut(&mut self) -> &mut Self { self } }
33
34#[test] fn test_traits_for_coverage() {
35    let _caps = Capabilities::zeroed();
36    let _caps = _caps.clone();
37    dbg!(_caps);
38}
39
40//#cpp2rust XINPUT_CAPABILITIES         = xinput::Capabilities