Registry / config / dotenv-codegen

dotenv-codegen

JSON →
library0.15.0rscratesunverified

A dotenv implementation for Rust that loads environment variables at compile time.

# Cargo.toml [dependencies] dotenv_codegen = "0.15.0"
INSTALL
IMPORT
SIG · DOTENV-CODEGEN
D
dotenv-codegen
configrustv0.15.0
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.

dotenv
use dotenv_codegen::dotenv;

Load an environment variable from a .env file at compile time.

use dotenv_codegen::dotenv; let value = dotenv!("MY_VAR"); println!("{}", value);
Debug
Known issues
gotchaRequires a .env file in the project root at compile time; missing file causes compilation error.
fix
Ensure a .env file exists with the required variables.
affects: *
Upgrade
Version history
0.15.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
44 hits · last 30 days
node
38
OpenAI (training)
1
Resources
dotenv-codegen — cargo add dotenv-codegen · libregistry