load

Return the resolved environment as a map

Rust

dotenvx_official::load()

Usage

Takes no arguments. Reads the current directory and process environment and returns io::Result<HashMap<String, String». Existing environment values take precedence and remain in the returned environment. Loading is strict. It does not mutate std::env or install an output filter.


fn main() -> std::io::Result<()> {
    let values = dotenvx_official::load()?;
    println!("Hello {}", values["HELLO"]);
    Ok(())
}

markdown