Function get_env::vars[][src]

pub fn vars() -> Option<Vec<(String, String)>>

Returns a vector of (variable, value) pairs of strings, for all the environment variables of the current process.

Errors

This will return None if get_env can't acquire them. Please file an issue.

Panics

Will panic if any key or value in the environment is not valid unicode. If this is not desired, consider using the get_env::vars_os function.

Examples

extern crate get_env;

// Prints the environment variables
for (key, value) in get_env::vars().expect("Couldn't retrieve env vars") {
    println!("{}: {}", key, value);
}