Expand description
This crate provides a configuration loader in the style of the ruby dotenv gem. This library is meant to be used on development or testing environments in which setting environment variables is not practical. It loads environment variables from a .env file, if available, and mashes those with the actual environment variables provided by the operating system.
Enums§
Functions§
- dotenv
- This is usually what you want. It loads the .env file located in the environment’s current directory or its parents in sequence.
- dotenv_
iter - Like
dotenv
, but returns an iterator over variables instead of loading into environment. - dotenv_
with_ prefix - It loads the .env file located in the environment’s current directory or its parents in sequence. Set the env vars with target prefix
- from_
filename - Loads the specified file from the environment’s current directory or its parents in sequence.
- from_
filename_ iter - Like
from_filename
, but returns an iterator over variables instead of loading into environment. - from_
filename_ with_ prefix - Loads the specified file from the environment’s current directory or its parents in sequence. Set the env vars with target prefix
- from_
path - Loads the file at the specified absolute path.
- from_
path_ iter - Like
from_path
, but returns an iterator over variables instead of loading into environment. - from_
path_ with_ prefix - Loads the file at the specified absolute path. Set the env vars with target prefix Examples
- get_
vars - Return the file parse result, and it will not set the env vars
- get_
vars_ with_ prefix - Return the file parse result, and it will not set the env vars get the vars with target prefix
- var
- After loading the dotenv file, fetches the environment variable key from the current process.
- vars
- After loading the dotenv file, returns an iterator of (variable, value) pairs of strings, for all the environment variables of the current process.