Skip to main content

apply_env_policy

Function apply_env_policy 

Source
pub fn apply_env_policy<I, K, V>(
    policy: SandboxEnvPolicy,
    base: I,
) -> Vec<(String, String)>
where I: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,
Expand description

Build the environment the subprocess should see, starting from base (the process’s own inherited environment, or ctx.shell_env’s snapshot when one is configured — the caller decides base, this function only applies the POLICY on top of it). Inherit returns base unchanged (byte-identical to pre-P5-10 behavior — the common case, since env_policy defaults to Inherit).