Skip to main content

Crate lockedenv

Crate lockedenv 

Source
Expand description

Type-safe, freeze-on-load environment variable management. Read and parse your environment once at startup into a generated struct.

Re-exports§

pub use error::EnvLockError;
pub use parse::FromEnvStr;
pub use parse::Secret;

Modules§

error
lock
Internal helpers for macro-generated code; not part of the public API.
parse

Macros§

check
Like load! but panics with all errors listed, not just the first. Accepts the same syntax as try_check!.
env_struct
Define a named, publicly accessible configuration struct with built-in load, try_load, from_map, and try_from_map associated functions.
from_map
try_from_map! variant that panics on failure.
load
Parse the environment and panic on error; returns the generated struct.
try_check
Like try_load! but collects all parse/missing errors instead of stopping at the first one. Returns Ok(config) when every field parsed successfully, or Err(Vec<EnvLockError>) listing every problem found.
try_from_map
Like try_load! but parses from a provided HashMap instead of the OS env.
try_load
Like load! but returns a Result<_, EnvLockError> instead of panicking.