Skip to main content

Module config

Module config 

Source

Functionsยง

env_f64
Read an environment variable as f64 with a default fallback. Returns default if the var is missing or cannot be parsed.
env_u32
Read an environment variable as u32 with a default fallback. Returns default if the var is missing or cannot be parsed.
env_u64
Read an environment variable as u64 with a default fallback. Returns default if the var is missing or cannot be parsed.
env_var_or_file
Read a configuration value from either a direct environment variable NAME or from a file path specified via NAME_FILE. If both are set, NAME takes precedence. Returns Some(value) if found, otherwise None.
env_var_or_file_required
Same as env_var_or_file, but returns an error message when not found.