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 EResult {
    Invalid = 0,
    OK = 1,
    Fail = 2,
    NoConnection = 3,
    InvalidPassword = 5,
    LoggedInElsewhere = 6,
    InvalidProtocolVer = 7,
    InvalidParam = 8,
    FileNotFound = 9,
    Busy = 10,
    InvalidState = 11,
    InvalidName = 12,
    InvalidEmail = 13,
    DuplicateName = 14,
    AccessDenied = 15,
    Timeout = 16,
    Banned = 17,
    AccountNotFound = 18,
    InvalidSteamID = 19,
    ServiceUnavailable = 20,
    NotLoggedOn = 21,
    Pending = 22,
    EncryptionFailure = 23,
    InsufficientPrivilege = 24,
    LimitExceeded = 25,
    Revoked = 26,
    Expired = 27,
    AlreadyRedeemed = 28,
    DuplicateRequest = 29,
    AlreadyOwned = 30,
    IPNotFound = 31,
    PersistFailed = 32,
    LockingFailed = 33,
    LogonSessionReplaced = 34,
    ConnectFailed = 35,
    HandshakeFailed = 36,
    IOFailure = 37,
    RemoteDisconnect = 38,
    ShoppingCartNotFound = 39,
    Blocked = 40,
    Ignored = 41,
    NoMatch = 42,
    AccountDisabled = 43,
    ServiceReadOnly = 44,
    AccountNotFeatured = 45,
    AdministratorOK = 46,
    ContentVersion = 47,
    TryAnotherCM = 48,
    PasswordRequiredToKickSession = 49,
    AlreadyLoggedInElsewhere = 50,
    Suspended = 51,
    Cancelled = 52,
    DataCorruption = 53,
    DiskFull = 54,
    RemoteCallFailed = 55,
    PasswordUnset = 56,
    ExternalAccountUnlinked = 57,
    PSNTicketInvalid = 58,
    ExternalAccountAlreadyLinked = 59,
    RemoteFileConflict = 60,
    IllegalPassword = 61,
    SameAsPreviousValue = 62,
    AccountLogonDenied = 63,
    CannotUseOldPassword = 64,
    InvalidLoginAuthCode = 65,
    AccountLogonDeniedNoMail = 66,
    HardwareNotCapableOfIPT = 67,
    IPTInitError = 68,
    ParentalControlRestricted = 69,
    FacebookQueryError = 70,
    ExpiredLoginAuthCode = 71,
    IPLoginRestrictionFailed = 72,
    AccountLockedDown = 73,
    AccountLogonDeniedVerifiedEmailRequired = 74,
    NoMatchingURL = 75,
    BadResponse = 76,
    RequirePasswordReEntry = 77,
    ValueOutOfRange = 78,
    UnexpectedError = 79,
    Disabled = 80,
    InvalidCEGSubmission = 81,
    RestrictedDevice = 82,
    RegionLocked = 83,
    RateLimitExceeded = 84,
    AccountLoginDeniedNeedTwoFactor = 85,
    ItemDeleted = 86,
    AccountLoginDeniedThrottle = 87,
    TwoFactorCodeMismatch = 88,
    TwoFactorActivationCodeMismatch = 89,
    AccountAssociatedToMultiplePartners = 90,
    NotModified = 91,
    NoMobileDevice = 92,
    TimeNotSynced = 93,
    SMSCodeFailed = 94,
    AccountLimitExceeded = 95,
    AccountActivityLimitExceeded = 96,
    PhoneActivityLimitExceeded = 97,
    RefundToWallet = 98,
    EmailSendFailure = 99,
    NotSettled = 100,
    NeedCaptcha = 101,
    GSLTDenied = 102,
    GSOwnerDenied = 103,
    InvalidItemType = 104,
    IPBanned = 105,
    GSLTExpired = 106,
    InsufficientFunds = 107,
    TooManyPending = 108,
    NoSiteLicensesFound = 109,
    WGNetworkSendExceeded = 110,
    AccountNotFriends = 111,
    LimitedUserAccount = 112,
    CantRemoveItem = 113,
    AccountDeleted = 114,
    ExistingUserCancelledLicense = 115,
    CommunityCooldown = 116,
    NoLauncherSpecified = 117,
    MustAgreeToSSA = 118,
    LauncherMigrated = 119,
    SteamRealmMismatch = 120,
    InvalidSignature = 121,
    ParseFailure = 122,
    NoVerifiedPhone = 123,
    InsufficientBattery = 124,
    ChargerRequired = 125,
    CachedCredentialInvalid = 126,
    PhoneNumberIsVOIP = 127,
    NotSupported = 128,
    FamilySizeLimitExceeded = 129,
    OfflineAppCacheInvalid = 130,
    TryLater = 131,
}

impl EResult {
    pub fn from_i32(val: i32) -> Option<Self> {
        match val {
            x if x == Self::Invalid as i32 => Some(Self::Invalid),
            x if x == Self::OK as i32 => Some(Self::OK),
            x if x == Self::Fail as i32 => Some(Self::Fail),
            x if x == Self::NoConnection as i32 => Some(Self::NoConnection),
            x if x == Self::InvalidPassword as i32 => Some(Self::InvalidPassword),
            x if x == Self::LoggedInElsewhere as i32 => Some(Self::LoggedInElsewhere),
            x if x == Self::InvalidProtocolVer as i32 => Some(Self::InvalidProtocolVer),
            x if x == Self::InvalidParam as i32 => Some(Self::InvalidParam),
            x if x == Self::FileNotFound as i32 => Some(Self::FileNotFound),
            x if x == Self::Busy as i32 => Some(Self::Busy),
            x if x == Self::InvalidState as i32 => Some(Self::InvalidState),
            x if x == Self::InvalidName as i32 => Some(Self::InvalidName),
            x if x == Self::InvalidEmail as i32 => Some(Self::InvalidEmail),
            x if x == Self::DuplicateName as i32 => Some(Self::DuplicateName),
            x if x == Self::AccessDenied as i32 => Some(Self::AccessDenied),
            x if x == Self::Timeout as i32 => Some(Self::Timeout),
            x if x == Self::Banned as i32 => Some(Self::Banned),
            x if x == Self::AccountNotFound as i32 => Some(Self::AccountNotFound),
            x if x == Self::InvalidSteamID as i32 => Some(Self::InvalidSteamID),
            x if x == Self::ServiceUnavailable as i32 => Some(Self::ServiceUnavailable),
            x if x == Self::NotLoggedOn as i32 => Some(Self::NotLoggedOn),
            x if x == Self::Pending as i32 => Some(Self::Pending),
            x if x == Self::EncryptionFailure as i32 => Some(Self::EncryptionFailure),
            x if x == Self::InsufficientPrivilege as i32 => Some(Self::InsufficientPrivilege),
            x if x == Self::LimitExceeded as i32 => Some(Self::LimitExceeded),
            x if x == Self::Revoked as i32 => Some(Self::Revoked),
            x if x == Self::Expired as i32 => Some(Self::Expired),
            x if x == Self::AlreadyRedeemed as i32 => Some(Self::AlreadyRedeemed),
            x if x == Self::DuplicateRequest as i32 => Some(Self::DuplicateRequest),
            x if x == Self::AlreadyOwned as i32 => Some(Self::AlreadyOwned),
            x if x == Self::IPNotFound as i32 => Some(Self::IPNotFound),
            x if x == Self::PersistFailed as i32 => Some(Self::PersistFailed),
            x if x == Self::LockingFailed as i32 => Some(Self::LockingFailed),
            x if x == Self::LogonSessionReplaced as i32 => Some(Self::LogonSessionReplaced),
            x if x == Self::ConnectFailed as i32 => Some(Self::ConnectFailed),
            x if x == Self::HandshakeFailed as i32 => Some(Self::HandshakeFailed),
            x if x == Self::IOFailure as i32 => Some(Self::IOFailure),
            x if x == Self::RemoteDisconnect as i32 => Some(Self::RemoteDisconnect),
            x if x == Self::ShoppingCartNotFound as i32 => Some(Self::ShoppingCartNotFound),
            x if x == Self::Blocked as i32 => Some(Self::Blocked),
            x if x == Self::Ignored as i32 => Some(Self::Ignored),
            x if x == Self::NoMatch as i32 => Some(Self::NoMatch),
            x if x == Self::AccountDisabled as i32 => Some(Self::AccountDisabled),
            x if x == Self::ServiceReadOnly as i32 => Some(Self::ServiceReadOnly),
            x if x == Self::AccountNotFeatured as i32 => Some(Self::AccountNotFeatured),
            x if x == Self::AdministratorOK as i32 => Some(Self::AdministratorOK),
            x if x == Self::ContentVersion as i32 => Some(Self::ContentVersion),
            x if x == Self::TryAnotherCM as i32 => Some(Self::TryAnotherCM),
            x if x == Self::PasswordRequiredToKickSession as i32 => Some(Self::PasswordRequiredToKickSession),
            x if x == Self::AlreadyLoggedInElsewhere as i32 => Some(Self::AlreadyLoggedInElsewhere),
            x if x == Self::Suspended as i32 => Some(Self::Suspended),
            x if x == Self::Cancelled as i32 => Some(Self::Cancelled),
            x if x == Self::DataCorruption as i32 => Some(Self::DataCorruption),
            x if x == Self::DiskFull as i32 => Some(Self::DiskFull),
            x if x == Self::RemoteCallFailed as i32 => Some(Self::RemoteCallFailed),
            x if x == Self::PasswordUnset as i32 => Some(Self::PasswordUnset),
            x if x == Self::ExternalAccountUnlinked as i32 => Some(Self::ExternalAccountUnlinked),
            x if x == Self::PSNTicketInvalid as i32 => Some(Self::PSNTicketInvalid),
            x if x == Self::ExternalAccountAlreadyLinked as i32 => Some(Self::ExternalAccountAlreadyLinked),
            x if x == Self::RemoteFileConflict as i32 => Some(Self::RemoteFileConflict),
            x if x == Self::IllegalPassword as i32 => Some(Self::IllegalPassword),
            x if x == Self::SameAsPreviousValue as i32 => Some(Self::SameAsPreviousValue),
            x if x == Self::AccountLogonDenied as i32 => Some(Self::AccountLogonDenied),
            x if x == Self::CannotUseOldPassword as i32 => Some(Self::CannotUseOldPassword),
            x if x == Self::InvalidLoginAuthCode as i32 => Some(Self::InvalidLoginAuthCode),
            x if x == Self::AccountLogonDeniedNoMail as i32 => Some(Self::AccountLogonDeniedNoMail),
            x if x == Self::HardwareNotCapableOfIPT as i32 => Some(Self::HardwareNotCapableOfIPT),
            x if x == Self::IPTInitError as i32 => Some(Self::IPTInitError),
            x if x == Self::ParentalControlRestricted as i32 => Some(Self::ParentalControlRestricted),
            x if x == Self::FacebookQueryError as i32 => Some(Self::FacebookQueryError),
            x if x == Self::ExpiredLoginAuthCode as i32 => Some(Self::ExpiredLoginAuthCode),
            x if x == Self::IPLoginRestrictionFailed as i32 => Some(Self::IPLoginRestrictionFailed),
            x if x == Self::AccountLockedDown as i32 => Some(Self::AccountLockedDown),
            x if x == Self::AccountLogonDeniedVerifiedEmailRequired as i32 => Some(Self::AccountLogonDeniedVerifiedEmailRequired),
            x if x == Self::NoMatchingURL as i32 => Some(Self::NoMatchingURL),
            x if x == Self::BadResponse as i32 => Some(Self::BadResponse),
            x if x == Self::RequirePasswordReEntry as i32 => Some(Self::RequirePasswordReEntry),
            x if x == Self::ValueOutOfRange as i32 => Some(Self::ValueOutOfRange),
            x if x == Self::UnexpectedError as i32 => Some(Self::UnexpectedError),
            x if x == Self::Disabled as i32 => Some(Self::Disabled),
            x if x == Self::InvalidCEGSubmission as i32 => Some(Self::InvalidCEGSubmission),
            x if x == Self::RestrictedDevice as i32 => Some(Self::RestrictedDevice),
            x if x == Self::RegionLocked as i32 => Some(Self::RegionLocked),
            x if x == Self::RateLimitExceeded as i32 => Some(Self::RateLimitExceeded),
            x if x == Self::AccountLoginDeniedNeedTwoFactor as i32 => Some(Self::AccountLoginDeniedNeedTwoFactor),
            x if x == Self::ItemDeleted as i32 => Some(Self::ItemDeleted),
            x if x == Self::AccountLoginDeniedThrottle as i32 => Some(Self::AccountLoginDeniedThrottle),
            x if x == Self::TwoFactorCodeMismatch as i32 => Some(Self::TwoFactorCodeMismatch),
            x if x == Self::TwoFactorActivationCodeMismatch as i32 => Some(Self::TwoFactorActivationCodeMismatch),
            x if x == Self::AccountAssociatedToMultiplePartners as i32 => Some(Self::AccountAssociatedToMultiplePartners),
            x if x == Self::NotModified as i32 => Some(Self::NotModified),
            x if x == Self::NoMobileDevice as i32 => Some(Self::NoMobileDevice),
            x if x == Self::TimeNotSynced as i32 => Some(Self::TimeNotSynced),
            x if x == Self::SMSCodeFailed as i32 => Some(Self::SMSCodeFailed),
            x if x == Self::AccountLimitExceeded as i32 => Some(Self::AccountLimitExceeded),
            x if x == Self::AccountActivityLimitExceeded as i32 => Some(Self::AccountActivityLimitExceeded),
            x if x == Self::PhoneActivityLimitExceeded as i32 => Some(Self::PhoneActivityLimitExceeded),
            x if x == Self::RefundToWallet as i32 => Some(Self::RefundToWallet),
            x if x == Self::EmailSendFailure as i32 => Some(Self::EmailSendFailure),
            x if x == Self::NotSettled as i32 => Some(Self::NotSettled),
            x if x == Self::NeedCaptcha as i32 => Some(Self::NeedCaptcha),
            x if x == Self::GSLTDenied as i32 => Some(Self::GSLTDenied),
            x if x == Self::GSOwnerDenied as i32 => Some(Self::GSOwnerDenied),
            x if x == Self::InvalidItemType as i32 => Some(Self::InvalidItemType),
            x if x == Self::IPBanned as i32 => Some(Self::IPBanned),
            x if x == Self::GSLTExpired as i32 => Some(Self::GSLTExpired),
            x if x == Self::InsufficientFunds as i32 => Some(Self::InsufficientFunds),
            x if x == Self::TooManyPending as i32 => Some(Self::TooManyPending),
            x if x == Self::NoSiteLicensesFound as i32 => Some(Self::NoSiteLicensesFound),
            x if x == Self::WGNetworkSendExceeded as i32 => Some(Self::WGNetworkSendExceeded),
            x if x == Self::AccountNotFriends as i32 => Some(Self::AccountNotFriends),
            x if x == Self::LimitedUserAccount as i32 => Some(Self::LimitedUserAccount),
            x if x == Self::CantRemoveItem as i32 => Some(Self::CantRemoveItem),
            x if x == Self::AccountDeleted as i32 => Some(Self::AccountDeleted),
            x if x == Self::ExistingUserCancelledLicense as i32 => Some(Self::ExistingUserCancelledLicense),
            x if x == Self::CommunityCooldown as i32 => Some(Self::CommunityCooldown),
            x if x == Self::NoLauncherSpecified as i32 => Some(Self::NoLauncherSpecified),
            x if x == Self::MustAgreeToSSA as i32 => Some(Self::MustAgreeToSSA),
            x if x == Self::LauncherMigrated as i32 => Some(Self::LauncherMigrated),
            x if x == Self::SteamRealmMismatch as i32 => Some(Self::SteamRealmMismatch),
            x if x == Self::InvalidSignature as i32 => Some(Self::InvalidSignature),
            x if x == Self::ParseFailure as i32 => Some(Self::ParseFailure),
            x if x == Self::NoVerifiedPhone as i32 => Some(Self::NoVerifiedPhone),
            x if x == Self::InsufficientBattery as i32 => Some(Self::InsufficientBattery),
            x if x == Self::ChargerRequired as i32 => Some(Self::ChargerRequired),
            x if x == Self::CachedCredentialInvalid as i32 => Some(Self::CachedCredentialInvalid),
            x if x == Self::PhoneNumberIsVOIP as i32 => Some(Self::PhoneNumberIsVOIP),
            x if x == Self::NotSupported as i32 => Some(Self::NotSupported),
            x if x == Self::FamilySizeLimitExceeded as i32 => Some(Self::FamilySizeLimitExceeded),
            x if x == Self::OfflineAppCacheInvalid as i32 => Some(Self::OfflineAppCacheInvalid),
            x if x == Self::TryLater as i32 => Some(Self::TryLater),
            _ => None,
        }
    }
}