Expand description
§dotenvs
A correct dotenv library with variable substitution.
- Variable substitution:
$VAR,${VAR},${VAR:-default} - Three quote styles (`’ “ ``), multi-line values
- Overwrite or preserve existing environment variables
exportprefix for shell compatibility
§Usage
Note:
The crate is named
dotenvs, but its lib isdotenv.
[dependencies]
dotenvs = "0.2"dotenv::load();
// iterate all variables
for (key, value) in dotenv::vars() {
println!("{}: {}", key, value);
}§License
Structs§
- Dotenv
- Parsed dotenv content
Enums§
- Error
- Errors that can occur when working with dotenv files.
Functions§
- from_
filename - Create
Dotenvfrom the specified file. - from_
path - Create
Dotenvfrom the specified path. - from_
read - Create
Dotenvfrom anyReadimplementor. - load
- Load the
.envfile from the current directory or its parents. - var
- Get the value for an environment variable.
- vars
- Return an iterator of
(key, value)pairs for all environment variables of the current process.