Skip to main content

steam_enums/
eclientstat.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 EClientStat {
6    P2PConnectionsUDP = 0,
7    P2PConnectionsRelay = 1,
8    P2PGameConnections = 2,
9    P2PVoiceConnections = 3,
10    BytesDownloaded = 4,
11}
12
13impl EClientStat {
14    pub fn from_i32(val: i32) -> Option<Self> {
15        match val {
16            x if x == Self::P2PConnectionsUDP as i32 => Some(Self::P2PConnectionsUDP),
17            x if x == Self::P2PConnectionsRelay as i32 => Some(Self::P2PConnectionsRelay),
18            x if x == Self::P2PGameConnections as i32 => Some(Self::P2PGameConnections),
19            x if x == Self::P2PVoiceConnections as i32 => Some(Self::P2PVoiceConnections),
20            x if x == Self::BytesDownloaded as i32 => Some(Self::BytesDownloaded),
21            _ => None,
22        }
23    }
24}