Skip to main content

vars

Function vars 

Source
pub fn vars() -> Vars
Expand description

Return an iterator of (key, value) pairs for all environment variables of the current process.

Automatically loads .env on first call. The returned iterator is a snapshot of the process environment at the time of invocation — subsequent modifications are not reflected.

§Examples

use std::io;

for (key, value) in dotenv::vars() {
    println!("{key}={value}");
}