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

Returns an iterator over environment variables from the specified path.

Examples

use dirs::home_dir;

let my_path = home_dir().map(|a| a.join("/absolute/path/.env")).unwrap();

for item in dotenvy::from_path_iter(my_path.as_path()).unwrap() {
  let (key, val) = item.unwrap();
  println!("{key}={val}");
}