Function dotenv::from_path_iter
[−]
[src]
pub fn from_path_iter(path: &Path) -> Result<Iter<File>>
Like from_path
, but returns an iterator over variables instead of loading into environment.
Examples
use dotenv; use std::env; use std::path::{Path}; let my_path = env::home_dir().and_then(|a| Some(a.join("/.env"))).unwrap(); let iter = dotenv::from_path_iter(my_path.as_path()).unwrap(); for item in iter { let (key, val) = item.unwrap(); println!("{}={}", key, val); }