envcast 1.0.0

Short, clear description of what the project does
Documentation
use std::sync::OnceLock;

use envcast::FromEnv;

#[derive(FromEnv)]
pub struct Config {
    #[default = 50]
    pub int_field: i32,

    #[default = 50.0]
    pub float_field: f32,

    #[default = "Rust"]
    pub string_field: String,

    #[default = true]
    pub bool_field: bool,
}

static CONFIG: OnceLock<Config> = OnceLock::new();

pub fn get_config() -> &'static Config {
    CONFIG.get_or_init(Config::get)
}

fn main() {
    println!("{}", get_config().string_field);
}