pub fn get_parse<K, T, E>(key: K) -> EnvmntResult<T> where
    K: AsRef<OsStr>,
    T: FromStr + FromStr<Err = E>,
    E: Display
Expand description

Returns the parsed environment variable value.

Arguments

  • key - The environment variable name

Example

fn main() {
    envmnt::set("ENV_VAR", "123");
    let value: i32 = envmnt::get_parse("ENV_VAR").unwrap();
    assert_eq!(value, 123);
}