[][src]Function dotenv::from_path

pub fn from_path<P: AsRef<Path>>(path: P) -> Result<()>

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());