Skip to main content

Module dotenv

Module dotenv 

Source
Expand description

Strict, dependency-free .env parser.

Plain KEY=VALUE lines with # comments and optional quotes. There is deliberately no interpolation, command substitution or ${VAR} expansion: a .env file holds secrets and is read before config.toml, so letting values reference each other (or the shell) would make the load order matter and open a recursion/injection surface.

Structs§

Assignment
One KEY=VALUE assignment, with where it came from.

Functions§

load
Read one file. A missing file is Ok(vec![]), not an error.
load_files
Read several files, later ones winning on key collision.
parse
Parse .env text. Returns assignments in file order.