Skip to main content

steam_enums/
estreamdatamessage.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 EStreamDataMessage {
6    DataPacket = 1,
7    DataLost = 2,
8}
9
10impl EStreamDataMessage {
11    pub fn from_i32(val: i32) -> Option<Self> {
12        match val {
13            x if x == Self::DataPacket as i32 => Some(Self::DataPacket),
14            x if x == Self::DataLost as i32 => Some(Self::DataLost),
15            _ => None,
16        }
17    }
18}