steam-enums 0.1.0

Steam protocol enumerations (EResult, EMsg, EAccountType, etc.) for Rust.
Documentation
#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(i32)]
pub enum EMarketingMessageType {
    Invalid = 0,
    NowAvailable = 1,
    WeekendDeal = 2,
    PrePurchase = 3,
    PlayNow = 4,
    PreloadNow = 5,
    General = 6,
    DemoQuit = 7,
    Gifting = 8,
    EJsKorner = 9,
    Update = 10,
    MidweekDeal = 11,
    DailyDeal = 12,
    NewDLC = 13,
    FreeWeekend = 14,
    SalePages = 15,
    PlaytestAvailable = 16,
}

impl EMarketingMessageType {
    pub fn from_i32(val: i32) -> Option<Self> {
        match val {
            x if x == Self::Invalid as i32 => Some(Self::Invalid),
            x if x == Self::NowAvailable as i32 => Some(Self::NowAvailable),
            x if x == Self::WeekendDeal as i32 => Some(Self::WeekendDeal),
            x if x == Self::PrePurchase as i32 => Some(Self::PrePurchase),
            x if x == Self::PlayNow as i32 => Some(Self::PlayNow),
            x if x == Self::PreloadNow as i32 => Some(Self::PreloadNow),
            x if x == Self::General as i32 => Some(Self::General),
            x if x == Self::DemoQuit as i32 => Some(Self::DemoQuit),
            x if x == Self::Gifting as i32 => Some(Self::Gifting),
            x if x == Self::EJsKorner as i32 => Some(Self::EJsKorner),
            x if x == Self::Update as i32 => Some(Self::Update),
            x if x == Self::MidweekDeal as i32 => Some(Self::MidweekDeal),
            x if x == Self::DailyDeal as i32 => Some(Self::DailyDeal),
            x if x == Self::NewDLC as i32 => Some(Self::NewDLC),
            x if x == Self::FreeWeekend as i32 => Some(Self::FreeWeekend),
            x if x == Self::SalePages as i32 => Some(Self::SalePages),
            x if x == Self::PlaytestAvailable as i32 => Some(Self::PlaytestAvailable),
            _ => None,
        }
    }
}