Skip to main content

steam_enums/
ebluetoothdevicetype.rs

1#![allow(non_camel_case_types)]
2#![allow(non_upper_case_globals)]
3#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
4#[repr(i32)]
5pub enum EBluetoothDeviceType {
6    Invalid = 0,
7    Unknown = 1,
8    Phone = 2,
9    Computer = 3,
10    Headset = 4,
11    Headphones = 5,
12    Speakers = 6,
13    OtherAudio = 7,
14    Mouse = 8,
15    Joystick = 9,
16    Gamepad = 10,
17    Keyboard = 11,
18}
19
20impl EBluetoothDeviceType {
21    pub fn from_i32(val: i32) -> Option<Self> {
22        match val {
23            x if x == Self::Invalid as i32 => Some(Self::Invalid),
24            x if x == Self::Unknown as i32 => Some(Self::Unknown),
25            x if x == Self::Phone as i32 => Some(Self::Phone),
26            x if x == Self::Computer as i32 => Some(Self::Computer),
27            x if x == Self::Headset as i32 => Some(Self::Headset),
28            x if x == Self::Headphones as i32 => Some(Self::Headphones),
29            x if x == Self::Speakers as i32 => Some(Self::Speakers),
30            x if x == Self::OtherAudio as i32 => Some(Self::OtherAudio),
31            x if x == Self::Mouse as i32 => Some(Self::Mouse),
32            x if x == Self::Joystick as i32 => Some(Self::Joystick),
33            x if x == Self::Gamepad as i32 => Some(Self::Gamepad),
34            x if x == Self::Keyboard as i32 => Some(Self::Keyboard),
35            _ => None,
36        }
37    }
38}