env_var_value

Function env_var_value 

Source
pub fn env_var_value<T>(name: T) -> String
where T: AsRef<str>,
Expand description

Gets the value of the environment variable with the given name.

It’s recommended to use env_var_name_exists to check if the variable exists before calling this function.

§Panics

This function traps if:

  • The length of name exceeds MAX_ENV_VAR_NAME_LENGTH.
  • The name does not match any existing environment variable.
  • The value is not valid UTF-8.