Skip to main content

get_env_bool

Function get_env_bool 

Source
pub fn get_env_bool(key: &str, default: bool) -> bool
Expand description

Retrieve an environment variable as a boolean, with a default value if not set or parsing fails.

#Parameters

  • key: The environment variable key to look up.
  • default: The default boolean value to return if the environment variable is not set or cannot be parsed.

#Returns

  • bool: The parsed boolean value if successful, otherwise the default value.