steam-enums 0.1.2

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 EEconTradeResponse {
    Accepted = 0,
    Declined = 1,
    TradeBannedInitiator = 2,
    TradeBannedTarget = 3,
    TargetAlreadyTrading = 4,
    Disabled = 5,
    NotLoggedIn = 6,
    Cancel = 7,
    TooSoon = 8,
    TooSoonPenalty = 9,
    ConnectionFailed = 10,
    AlreadyTrading = 11,
    AlreadyHasTradeRequest = 12,
    NoResponse = 13,
    CyberCafeInitiator = 14,
    CyberCafeTarget = 15,
    SchoolLabInitiator = 16,
    SchoolLabTarget = 17,
    InitiatorBlockedTarget = 18,
    InitiatorNeedsVerifiedEmail = 20,
    InitiatorNeedsSteamGuard = 21,
    TargetAccountCannotTrade = 22,
    InitiatorSteamGuardDuration = 23,
    InitiatorPasswordResetProbation = 24,
    InitiatorNewDeviceCooldown = 25,
    InitiatorSentInvalidCookie = 26,
    NeedsEmailConfirmation = 27,
    InitiatorRecentEmailChange = 28,
    NeedsMobileConfirmation = 29,
    TradingHoldForClearedTradeOffersInitiator = 30,
    WouldExceedMaxAssetCount = 31,
    DisabledInRegion = 32,
    DisabledInPartnerRegion = 33,
    OKToDeliver = 50,
}

impl EEconTradeResponse {
    pub fn from_i32(val: i32) -> Option<Self> {
        match val {
            x if x == Self::Accepted as i32 => Some(Self::Accepted),
            x if x == Self::Declined as i32 => Some(Self::Declined),
            x if x == Self::TradeBannedInitiator as i32 => Some(Self::TradeBannedInitiator),
            x if x == Self::TradeBannedTarget as i32 => Some(Self::TradeBannedTarget),
            x if x == Self::TargetAlreadyTrading as i32 => Some(Self::TargetAlreadyTrading),
            x if x == Self::Disabled as i32 => Some(Self::Disabled),
            x if x == Self::NotLoggedIn as i32 => Some(Self::NotLoggedIn),
            x if x == Self::Cancel as i32 => Some(Self::Cancel),
            x if x == Self::TooSoon as i32 => Some(Self::TooSoon),
            x if x == Self::TooSoonPenalty as i32 => Some(Self::TooSoonPenalty),
            x if x == Self::ConnectionFailed as i32 => Some(Self::ConnectionFailed),
            x if x == Self::AlreadyTrading as i32 => Some(Self::AlreadyTrading),
            x if x == Self::AlreadyHasTradeRequest as i32 => Some(Self::AlreadyHasTradeRequest),
            x if x == Self::NoResponse as i32 => Some(Self::NoResponse),
            x if x == Self::CyberCafeInitiator as i32 => Some(Self::CyberCafeInitiator),
            x if x == Self::CyberCafeTarget as i32 => Some(Self::CyberCafeTarget),
            x if x == Self::SchoolLabInitiator as i32 => Some(Self::SchoolLabInitiator),
            x if x == Self::SchoolLabTarget as i32 => Some(Self::SchoolLabTarget),
            x if x == Self::InitiatorBlockedTarget as i32 => Some(Self::InitiatorBlockedTarget),
            x if x == Self::InitiatorNeedsVerifiedEmail as i32 => Some(Self::InitiatorNeedsVerifiedEmail),
            x if x == Self::InitiatorNeedsSteamGuard as i32 => Some(Self::InitiatorNeedsSteamGuard),
            x if x == Self::TargetAccountCannotTrade as i32 => Some(Self::TargetAccountCannotTrade),
            x if x == Self::InitiatorSteamGuardDuration as i32 => Some(Self::InitiatorSteamGuardDuration),
            x if x == Self::InitiatorPasswordResetProbation as i32 => Some(Self::InitiatorPasswordResetProbation),
            x if x == Self::InitiatorNewDeviceCooldown as i32 => Some(Self::InitiatorNewDeviceCooldown),
            x if x == Self::InitiatorSentInvalidCookie as i32 => Some(Self::InitiatorSentInvalidCookie),
            x if x == Self::NeedsEmailConfirmation as i32 => Some(Self::NeedsEmailConfirmation),
            x if x == Self::InitiatorRecentEmailChange as i32 => Some(Self::InitiatorRecentEmailChange),
            x if x == Self::NeedsMobileConfirmation as i32 => Some(Self::NeedsMobileConfirmation),
            x if x == Self::TradingHoldForClearedTradeOffersInitiator as i32 => Some(Self::TradingHoldForClearedTradeOffersInitiator),
            x if x == Self::WouldExceedMaxAssetCount as i32 => Some(Self::WouldExceedMaxAssetCount),
            x if x == Self::DisabledInRegion as i32 => Some(Self::DisabledInRegion),
            x if x == Self::DisabledInPartnerRegion as i32 => Some(Self::DisabledInPartnerRegion),
            x if x == Self::OKToDeliver as i32 => Some(Self::OKToDeliver),
            _ => None,
        }
    }
}