[][src]Function envmnt::exists

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

Returns true environment variable is defined.

Arguments

  • key - The environment variable name

Example

extern crate envmnt;

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