pub fn exists<K: AsRef<OsStr>>(key: K) -> bool
Expand description

Returns true environment variable is defined.

Arguments

  • key - The environment variable name

Example

fn main() {
    if !envmnt::exists("MY_ENV_VAR") {
        envmnt::set("MY_ENV_VAR", "SOME VALUE");
        assert!(envmnt::is_equal("MY_ENV_VAR", "SOME VALUE"));
    }
}