Registry / config / genv
library0.1.18rscratesunverified

Global static variable initialized from environment variables.

# Cargo.toml [dependencies] genv = "0.1.18"
INSTALL
IMPORT
SIG · GENV
G
genv
configrustv0.1.18
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.

genv
✓ use genv::genv;

Define a global static variable from an environment variable.

use genv::genv; genv! { static MY_VAR: String = "MY_VAR"; } fn main() { println!("{}", MY_VAR); }
Debug
Known issues
gotchaThe macro generates code that panics if the environment variable is not set.
fix
Ensure the environment variable is set before accessing the static.
affects: >=0.1.0
Upgrade
Version history
0.1.18latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
37 hits · last 30 days
node
34
Resources
genv — cargo add genv · libregistry