Function dotenv::from_filename [] [src]

pub fn from_filename(filename: &str) -> Result<()DotenvError>

Loads the specified file from the same directory as the current executable.

Examples

use dotenv;
dotenv::from_filename("custom.env").ok();

It is also possible to do the following, but it is equivalent to using dotenv::dotenv(), which is preferred.

use dotenv;
dotenv::from_filename(".env").ok();