Envconfig
Build a config structure from environment variables in Rust without boilerplate.
Usage
Let's say you application relies on the following environment variables:
DB_HOST
DB_PORT
And you want to initialize Config
structure like this one:
You can achieve this with the following code without boilerplate:
extern crate envconfig_derive;
extern crate envconfig;
use Envconfig;
Running tests
Tests do some manipulation with environment variables, so to prevent flaky tests they have to be executed in a single thread:
cargo test -- --test-threads=1
Roadmap
- - migrate to the latest versions of
syn
andquote
- - support
Option<T>
(issue) - - support
default
attribute (issue) - - support nested structures?
License
Contributors
- greyblake Potapov Sergey - creator, maintainer.