ez_cfg

Crates.ioez_cfg
lib.rsez_cfg
version0.1.1
sourcesrc
created_at2024-09-21 10:09:05.090798
updated_at2024-09-21 18:10:13.965421
descriptionSimple env config library for Rust
homepage
repositoryhttps://github.com/JajaNooba/ez-config
max_upload_size
id1382115
size2,504
(JajaNooba)

documentation

https://docs.rs/ez_config/latest/ez_config

README

ez_config: Simple env config library for Rust

Overview

Ez_config allows to load config from env variables or .env file.

Example

use ez_config::*;

#[derive(Config)]
struct MyConfig {
  token: String,
  debug_mode: bool,
  some_numeber: i32
}

fn main() {
  // load config from env
  let my_config = MyConfig::load();

  // rest of the program
}

In .env file

TOKEN="my_secret_token"
DEBUG_MODE=false
SOME_NUMBER=123
Commit count: 5

cargo fmt