Skip to main content

Crate dotenvor

Crate dotenvor 

Source
Expand description

Parse and load .env files.

EnvLoader::load is the safe default and returns a process-isolated in-memory map.

Convenience loaders (dotenv, from_path, from_paths, from_filename) mutate the process environment and are unsafe, because callers must guarantee no concurrent process-environment access.

The load attribute macro offers startup-loading ergonomics for Result-returning functions. fn main stays safe; other annotated functions become unsafe fn so process-env mutation keeps its safety contract.

Structs§

Entry
A parsed KEY=VALUE entry from a .env file or input buffer.
EnvLoader
Builder-style dotenv loader.
LoadReport
Summary of the load operation.
LoadedEnv
Result of a safe in-memory load.
ParseError
TargetEnv
Destination for loaded environment variables.

Enums§

Encoding
Encoding choice for input data.
Error
KeyParsingMode
Key validation behavior for parser and loader entry parsing.
ParseErrorKind
SubstitutionMode
Variable expansion behavior for loader values.

Functions§

dotenv
Load .env from the current working directory into the process environment.
from_filename
Load a dotenv file by filename into the process environment.
from_path
Load a .env file from a specific path into the process environment.
from_paths
Load multiple .env files into the process environment.
parse_bytes
Parse dotenv entries from UTF-8 bytes.
parse_bytes_with_mode
Parse dotenv entries from UTF-8 bytes using a specific key parsing mode.
parse_reader
Parse dotenv entries from a buffered reader.
parse_reader_with_mode
Parse dotenv entries from a buffered reader using a specific key parsing mode.
parse_str
Parse dotenv entries from UTF-8 text.
parse_str_with_mode
Parse dotenv entries from UTF-8 text using a specific key parsing mode.

Attribute Macros§

load
Load .env entries into the process environment before running a function.