| Crates.io | ez_cfg |
| lib.rs | ez_cfg |
| version | 0.1.1 |
| created_at | 2024-09-21 10:09:05.090798+00 |
| updated_at | 2024-09-21 18:10:13.965421+00 |
| description | Simple env config library for Rust |
| homepage | |
| repository | https://github.com/JajaNooba/ez-config |
| max_upload_size | |
| id | 1382115 |
| size | 2,504 |
Ez_config allows to load config from env variables or .env file.
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