3 releases (stable)

new 1.0.1 Jan 13, 2025
0.0.0 Jan 13, 2025

#127 in Configuration

Download history 249/week @ 2024-10-15 39/week @ 2024-10-22 26/week @ 2024-10-29 35/week @ 2024-11-05 38/week @ 2024-11-12 133/week @ 2024-11-19 135/week @ 2024-11-26 170/week @ 2024-12-03 128/week @ 2024-12-10 135/week @ 2024-12-17 120/week @ 2024-12-24 205/week @ 2024-12-31 179/week @ 2025-01-07

672 downloads per month
Used in 7 crates

MIT license

5KB

env

rust 2024

Provides a safe interface for std::env::{set_var, remove_var}.

Rationale

Since #124636, std::env::set_var and std::env::remove_var} have become unsafe, due to their being unsafe when in a multi-threaded unix context^1.

This crate wraps these functions, adding runtime checks to ensure thread safety on unix systems, making them safe again.


lib.rs:

Inspection and manipulation of the process's environment.

This module contains functions to inspect various aspects such as environment variables, process arguments, the current directory, and various other important directories.

There are several functions and structs in this module that have a counterpart ending in os. Those ending in os will return an OsString and those without will return a String.

This crate provides [mod@std::env]::{[set_var], [remove_var]} safely.

Dependencies

~14KB