Skip to main content

apply

Function apply 

Source
pub unsafe fn apply(environment: &LoadedEnvironment) -> Result<(), ApplyError>
Expand description

Apply every loaded value to the current process environment.

This sets only the keys present in the loaded environment. It does not clear or remove any existing process variables. Every key and value is validated before the first mutation.

§Safety

The process environment is global and not thread-safe on all platforms. The caller must ensure that no other thread is concurrently reading or writing the process environment and must accept that process-environment changes cannot be rolled back. Prefer consuming LoadedEnvironment::values as a map unless process-global mutation is actually required.

§Errors

Returns ApplyError before changing anything when validation fails.