Skip to main content

get_env_str

Function get_env_str 

Source
pub fn get_env_str(key: &str, default: &str) -> String
Expand description

Retrieve an environment variable as a String, with a default value if not set.

#Parameters

  • key: The environment variable key to look up.
  • default: The default string value to return if the environment variable is not set.

#Returns

  • String: The environment variable value if set, otherwise the default value.