Registry / utility / environmental

environmental

JSON →
library1.1.4rscratesunverified

Sets scope-limited values that can be accessed statically.

# Cargo.toml [dependencies] environmental = "1.1.4"
INSTALL
IMPORT
SIG · ENVIRONMENTAL
E
environmental
utilityrustv1.1.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

environmental
✓ use environmental::environmental;

Define and use a thread-local scope-limited value.

use environmental::environmental; environmental!(THREAD_LOCAL: u32); fn main() { THREAD_LOCAL::set(|| 42); assert_eq!(THREAD_LOCAL::get(|&x| x), Some(42)); }
Debug
Known issues
gotchaValues are thread-local; not accessible across threads.
fix
Use `std::sync::OnceLock` or `lazy_static` for global state.
affects: >=0.0.0
Upgrade
Version history
1.1.4latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
environmental — cargo add environmental · libregistry