Crates.io | env-inventory |
lib.rs | env-inventory |
version | 0.2.3 |
source | src |
created_at | 2023-09-20 03:07:35.190713 |
updated_at | 2023-09-28 07:27:23.875491 |
description | A simple library to load globally available environment variables into a static inventory. |
homepage | |
repository | https://github.com/safai-labs/env-inventory.git |
max_upload_size | |
id | 977766 |
size | 33,529 |
env-inventory
is a Rust library designed to manage and consolidate the process of fetching parameters from the environment. It offers a flexible system to work with environment variables and configurations stored in TOML files.
Add env-inventory
to your Cargo.toml
:
[dependencies]
env-inventory = "0.2" # Check crates.io for the latest version
RequiredVar
struct.env_inventory::register!("DATABASE_URL");
let paths = ["path/to/settings.toml"];
env_inventory::load_and_validate_env_vars(&paths, "env").unwrap();
The library provides an EnvInventoryError
enum to handle various error types such as:
Pull requests are welcome. Please ensure that your PR passes all the tests before submitting. Unless otherwise stated, your contributions are assumed to be under the MIT license.