Skip to main content

resolve_env_value

Function resolve_env_value 

Source
pub fn resolve_env_value(value: &str) -> Result<String, EnvResolutionError>
Expand description

Resolve a single environment variable value

If the value starts with $E:, look up the remainder in std::env::var(). Otherwise, return the value unchanged.

§Arguments

  • value - The value to resolve (possibly with $E: prefix)

§Returns

  • Ok(String) - The resolved value
  • Err(EnvResolutionError) - If a $E: reference cannot be resolved

§Errors

Returns an error if a $E: referenced environment variable is not set.