Skip to main content

Module config

Module config 

Source
Expand description

One loading contract for application-owned conf::Conf schemas.

Values resolve as defaults < TOML < environment < CLI. Loading never changes the process environment or constructs application services. Schema derives supply field names, parsing, help, and secret-aware diagnostics.

Modules§

example
Reads an annotated example configuration, commented settings included.
interpolate
Environment substitution in TOML string values, before source overrides. Keys are never interpolated. Inserted values are literal, not TOML source.
reference
Configuration reference generated from the schema itself.

Structs§

ByteSize
Byte size representation.
Loaded
Loader
The application selects its namespace and schema; the loader owns sources.
OptionalAddress
A listener address that may be explicitly disabled with "off".
OptionalBytes
A byte limit that may be explicitly lifted with "unlimited".
OptionalDuration
A duration that may be explicitly turned off with "off" or "none".
SecretString
Configuration credentials stay redacted even when the whole schema is logged.
TomlTable
A TOML table of entries keyed by the name an operator chose.
TomlValue
One TOML value handed over as its own text.

Enums§

ConfigError
ConfigSearch
Tests use explicit paths so developer files cannot change their defaults.
Source
Metadata only: configuration values, including credentials, are never kept.
TextSource
Text written inline or read from a file: "value" or { file = "/path" }.

Functions§

deserialize_bytes
TOML can use an integer byte count or the human-readable CLI spelling.
deserialize_secret
Serde type errors normally quote the rejected value. Secret fields must replace that diagnostic before the configuration parser sees it.
parse_bytes
The same byte-size spelling for environment variables and CLI arguments.
parse_duration
Parse duration object 1hour 12min 5s
parse_optional_address
parse_optional_bytes
parse_optional_duration
read_credential
Reads a credential that also has a command-line flag.