Skip to main content

get_env_usize

Function get_env_usize 

Source
pub fn get_env_usize(key: &str, default: usize) -> usize
Expand description

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

#Parameters

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

#Returns

  • usize: The parsed value as usize if successful, otherwise the default value.