2 unstable releases
new 0.2.0 | Mar 15, 2025 |
---|---|
0.1.0 | Mar 7, 2025 |
#328 in Configuration
124 downloads per month
8KB
55 lines
env-vars-config
A simple lib for configuring your applications via environment variables.
Minimum supported rustc
1.80.0+
This version is explicitly tested in CI and may be bumped in any release as needed. Maintaining compatibility with older compilers is a priority though, so the bar for bumping the minimum supported version is set very high. Any changes to the supported minimum version will be called out in the release notes.
Usage
[dependencies]
env-vars-config = "0.1"
use env_vars_config::env_vars_config;
env_vars_config! {
SERVER_ADDRESS: String = "0.0.0.0:8080",
WORKERS_COUNT: i32 = 32
}
fn main() {
println!("server address: {}", config::SERVER_ADDRESS.as_str());
println!("workers count: {}", config::WORKERS_COUNT.clone());
}
Dependencies
~86KB