Skip to main content

load

Function load 

Source
pub fn load() -> Result<PathBuf>
Expand description

Load the .env file from the current directory or its parents.

Searches upward from the current working directory until .env is found. The first call loads variables; subsequent calls are no-ops through Dotenv::load (existing variables are preserved).

§Errors

Returns Error::Io if no .env file is found or it cannot be read.

§Examples

dotenv::load().ok();