Crates.io | all_env |
lib.rs | all_env |
version | 0.1.0 |
source | src |
created_at | 2024-01-19 12:49:53.884888 |
updated_at | 2024-01-19 12:49:53.884888 |
description | A library to retrieve environment variables from different file types. |
homepage | |
repository | |
max_upload_size | |
id | 1105255 |
size | 11,419 |
EnvVar is a Rust library for retrieving environment variables from different file types.
Add the following to your Cargo.toml
file:
[dependencies]
all_env = "0.1.0"
use all_env::EnvHolder;
// With debug flag set to true
let env_holder = EnvHolder::new(true);
let url = env_holder.get_var("url");
if let Some(url_value) = url {
// Further processing
}
use all_env::EnvHolder;
// With debug flag set to true
let env_holder = EnvHolder::new(false).with_file_name("custom_file.env");
let url = env_holder.get_var("url");
if let Some(url_value) = url {
// Further processing
}
Contributions are welcome! If you find a bug, have a feature request, or would like to contribute to the project, please feel free to open an issue or submit a pull request. Your feedback and contributions help make this library better for everyone.