adotenv-figment
A figment provider for literal
adotenv documents.
use parse_strict;
use AdotenvProvider;
use Figment;
let doc = parse_strict?;
let figment = new.merge;
from_values accepts an explicit map. Enable the load feature to use
from_environment with a LoadedEnvironment.
Value and key behavior
The provider exposes a Profile::Default dictionary with the original key
spelling. Figment's path-oriented lookup APIs still treat dots as separators;
extraction into a literal map or a matching typed structure is the lossless
route. Values are strings: deserialize string fields or convert explicitly.
The adapter does not infer numeric or boolean types.
use Deserialize;
let raw: RawApp = new
.merge
.extract?;
let port: u16 = raw.port.parse?;
Duplicate policy, nonparticipating keys and BareKeys::Empty follow the wrapped
document or loaded environment. No expansion, command execution or implicit
file access occurs.
This crate is part of the adotenv workspace
and supports Rust 1.81.