Function dotenv::from_path [] [src]

pub fn from_path(path: &Path) -> Result<()DotenvError>

Loads the file at the specified absolute path.

Examples

use dotenv;
use std::env;
use std::path::{Path};

let my_path = env::home_dir().and_then(|a| Some(a.join("/.env"))).unwrap();
dotenv::from_path(my_path.as_path());