Skip to main content

apply_env_at_path_vars

Function apply_env_at_path_vars 

Source
pub fn apply_env_at_path_vars(
    base: &mut Value,
    vars: impl IntoIterator<Item = (String, String)>,
    env_vars: &[&str],
    path: &[&str],
    decode: EnvDecode,
    overwrite: bool,
) -> Result<(), String>
Expand description

Decodes one key from supplied environment variables into base at the supplied path.

Identical to apply_env_at_path except for where the variables come from. Callers that read the process environment once and reuse it pass it here, and tests pass their own variables so that they do not depend on the ambient process environment.

ยงErrors

Returns a message when the environment value is malformed for decode.