pub fn from_path_iter<P: AsRef<Path>>(path: P) -> Result<Iter<File>>
Expand description

Like from_path, but returns an iterator over variables instead of loading into environment.

Examples

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

let my_path = dirs::home_dir().map(|a| a.join("/.env")).unwrap();
let iter = dotenvy::from_path_iter(my_path.as_path()).unwrap();

for item in iter {
  let (key, val) = item.unwrap();
  println!("{}={}", key, val);
}