pzzld-server 0.0.2

A production ready server optimized for WASM applications
Documentation
/*
    Appellation: environment <module>
    Contrib: FL03 <jo3mccain@icloud.com>
*/
#[doc(inline)]
pub use self::targets::*;

#[derive(
    Clone,
    Copy,
    Debug,
    Default,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
    serde::Deserialize,
    serde::Serialize,
    strum::AsRefStr,
    strum::Display,
    strum::EnumCount,
    strum::EnumIs,
    strum::EnumIter,
    strum::VariantArray,
    strum::VariantNames,
)]
#[serde(rename_all = "lowercase")]
#[strum(serialize_all = "lowercase")]
pub enum Environment {
    #[default]
    Development,
    Staging,
    Production,
}

impl Environment {
    pub fn development() -> Self {
        Self::Development
    }

    pub fn staging() -> Self {
        Self::Staging
    }

    pub fn production() -> Self {
        Self::Production
    }
}

mod targets {

    #[derive(
        Clone,
        Copy,
        Debug,
        Default,
        Eq,
        Hash,
        Ord,
        PartialEq,
        PartialOrd,
        clap::ValueEnum,
        serde::Deserialize,
        serde::Serialize,
        strum::AsRefStr,
        strum::Display,
        strum::EnumCount,
        strum::EnumIs,
        strum::EnumIter,
        strum::EnumString,
        strum::VariantArray,
        strum::VariantNames,
    )]
    #[serde(rename_all = "lowercase")]
    #[strum(serialize_all = "lowercase")]
    pub enum ApplicationType {
        Desktop,
        Mobile,
        #[default]
        Web,
    }

    impl ApplicationType {
        pub fn desktop() -> Self {
            Self::Desktop
        }

        pub fn mobile() -> Self {
            Self::Mobile
        }

        pub fn web() -> Self {
            Self::Web
        }
    }
}