mr_env_plus 0.1.0

Environment configuration management for Rust
Documentation
use mr_env_plus::EnvConfig;

#[derive(EnvConfig, Debug)]
pub struct Config {
    #[env(name = "APP_NAME", required = true)]
    pub app_name: String,

    #[env(name = "APP_PORT", default = "8080")]
    pub port: u16,

    #[env(name = "DEBUG_MODE", default = "false")]
    pub debug: bool,
}

fn main() {
    
    mr_env_plus::init().ok();
    
    let config = Config::from_env();
    println!("Config: {:?}", config);
}