adotenv-config
A config source adapter for literal
adotenv documents.
use parse_strict;
use AdotenvSource;
let doc = parse_strict?;
let config = builder
.add_source
.build?;
assert_eq!;
assert_eq!;
Typed extraction uses config's scalar coercion:
use Deserialize;
let app: App = config.try_deserialize?;
from_values accepts an explicit map. The load feature adds from_environment
for LoadedEnvironment.
Keys
config lowercases names and treats . as a nested path separator. Keys A.B
and a.b therefore collide. The adapter does not rewrite keys. Use from_values
when keys are already normalized for config.
Values are decoded literals. Duplicate policy, lookup participation and
BareKeys::Empty follow the source document or loaded environment. The adapter
performs no expansion, command execution or file access.
The crate is built against config 0.14 and supports Rust 1.81.