#env-var #lifetime #env

dev scoped-env

A lifetime scoped env variable setting

3 stable releases

2.1.0 Jan 15, 2021
2.0.0 Feb 5, 2020
1.0.0 Jan 31, 2020

#913 in Configuration

Download history 7714/week @ 2025-12-17 5645/week @ 2025-12-24 6722/week @ 2025-12-31 14886/week @ 2026-01-07 11590/week @ 2026-01-14 26498/week @ 2026-01-21 20122/week @ 2026-01-28 52280/week @ 2026-02-04 51367/week @ 2026-02-11 70233/week @ 2026-02-18 90377/week @ 2026-02-25 98905/week @ 2026-03-04 105584/week @ 2026-03-11 62371/week @ 2026-03-18 47882/week @ 2026-03-25 65374/week @ 2026-04-01

300,034 downloads per month
Used in 6 crates

Custom license

5KB
79 lines

scoped-env

A helper struct (mostly for tests) that scopes an environment variable lifetime to that of a rust scope. Useful for setting environment variables that should be local to the test function.

Usage

Add this to your Cargo.toml:

[dependencies]
scoped-env = "2.1.0"

No runtime deps