Skip to main content

Module config

Module config 

Source
Expand description

Configuration file discovery and loading.

Provides the three-stage config search (explicit path → ./config.toml$XDG_CONFIG_HOME/<app>/config.toml) and a generic TOML loader that produces semantic errors.

Structs§

CommonConfigFile
Common config-file fields shared by every project crate. Flatten into your ConfigFileRaw with #[serde(flatten)].

Enums§

ConfigFileError

Functions§

find_config_file
Locate a configuration file using a two-stage search:
load_toml
Deserialise a TOML file into T, wrapping I/O and parse failures in ConfigFileError.
resolve_log_settings
Resolve log_level and log_format from CLI → config-file → defaults.
xdg_config_dir
Resolve $XDG_CONFIG_HOME/<app_name>, falling back to $HOME/.config/<app_name> when the variable is unset.