Expand description
Fast .env file parser with variable interpolation, multi-file layering, and type-safe loading.
§Quick Start
use philiprehberger_dotenv::DotEnv;
let env = DotEnv::load().expect("failed to load .env");
let port: u16 = env.get_as("PORT").expect("invalid PORT");
let debug: bool = env.get_bool("DEBUG").expect("invalid DEBUG");§Features
- Parse
.envfiles with quoted values, comments, and escape sequences - Variable interpolation using
${VAR_NAME}syntax - Multi-file layering with priority ordering
- Type-safe accessors for common types
- Required variable validation
Structs§
- DotEnv
- A loaded set of environment variables parsed from
.envfiles.
Enums§
- DotEnv
Error - Errors that can occur when loading or accessing environment variables.
Functions§
- load
- Load environment variables from a
.envfile in the current directory. - load_
and_ apply - Load environment variables from
.envand set them into the process environment.