config
Settings are merged from a global config file, per-directory config files
walked from filesystem root down to $CWD, and GEST_-prefixed environment
variables (highest precedence).
| Name | Summary |
|---|---|
colors |
User-configurable color and text style definitions. |
database |
Database connection settings (URL or individual components). |
env |
Environment variable definitions used by the config system. |
loader |
Finding, reading and merging the layered config files and GEST_ environment variables into Settings. |
log |
Log-related configuration (level filtering). Log-related configuration ([log] table). |
pager |
Pager-related configuration ([pager] table). Pager-related configuration ([pager] table). |
serve |
Web server configuration ([serve] table). Web server configuration ([serve] table). |
storage |
Storage-related configuration (data directory resolution). |
Re-exports active_global_config_path, active_project_config_paths, load.
enum Error
pub enum ErrorErrors that can occur when loading configuration.
| Variant | Description |
|---|---|
Parse(Error) |
A config file contained invalid TOML. |
Read(Error) |
An I/O error occurred while reading a config file. |
RemoteDatabaseUnsupported |
database.url (or database.host) is set, but this build cannot connect to a remote database. |
XDGDirNotFound(&'static str) |
The XDG base directory could not be resolved (e.g. $HOME is unset). |
Implements From<Error>, Debug, Error, Display.
struct Settings
pub struct SettingsGest configuration settings, merged from global and per-directory config files.
| Field | Type | Description |
|---|---|---|
colors |
colors::Settings | Settings for color and style customization ([colors] table). |
database |
database::Settings | Settings for database connectivity ([database] table). |
log |
log::Settings | Settings for log output ([log] table). |
pager |
pager::Settings | Settings for the pager helper ([pager] table). |
serve |
serve::Settings | Settings for the built-in web dashboard ([serve] table). |
storage |
storage::Settings | Settings for data storage locations ([storage] table). |
Implements Clone, Debug, Default, Deserialize<'de>, PartialEq, Serialize.
Settings::colors
pub fn colors(&self) -> &SettingsSettings for color and style customization ([colors] table).
| Parameter | Type | Description |
|---|---|---|
| returns | &Settings |
Settings::database
pub fn database(&self) -> &SettingsSettings for database connectivity ([database] table).
| Parameter | Type | Description |
|---|---|---|
| returns | &Settings |
Settings::log
pub fn log(&self) -> &SettingsSettings for log output ([log] table).
| Parameter | Type | Description |
|---|---|---|
| returns | &Settings |
Settings::pager
pub fn pager(&self) -> &SettingsSettings for the pager helper ([pager] table).
| Parameter | Type | Description |
|---|---|---|
| returns | &Settings |
Settings::serve
pub fn serve(&self) -> &SettingsSettings for the built-in web dashboard ([serve] table).
| Parameter | Type | Description |
|---|---|---|
| returns | &Settings |
Settings::storage
pub fn storage(&self) -> &SettingsSettings for data storage locations ([storage] table).
| Parameter | Type | Description |
|---|---|---|
| returns | &Settings |