pub fn var<K: AsRef<OsStr>>(key: K) -> Result<String>Expand description
Get the value for an environment variable.
The value is Ok(s) if the environment variable is present and valid unicode.
Note: this function gets values from any visible environment variable key, regardless of whether a .env file was loaded.
ยงExamples:
let value = dotenv::var("HOME").unwrap();
println!("{}", value); // prints `/home/foo`