dotenv-proc 0.1.0

A simple proc-macro crate to use a .env file.
Documentation
  • Coverage
  • 0%
    0 out of 3 items documented0 out of 2 items with examples
  • Size
  • Source code size: 14.25 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 273.96 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 5s Average build duration of successful builds.
  • all releases: 5s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • SCool62/dotenv
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • SCool62

Dotenv

Small, proc-macro crate that bakes environment variables from a .env file into the compiled binary. The dotenv!() macro is used the same as the built-in env!() macro, and the dotenv_option!() macro is used the same as option_env!().

Usage

.env file

FOO=BAR

In rust:

const FOO = dotenv!("FOO");

dotenv!("FOO") will expand at compile time to a &'static str of whatever FOO is set to in the .env file (in this case "bar").