config

Layered configuration loading and typed settings for the gest CLI.

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

source

pub enum Error

Errors 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

source

pub struct Settings

Gest 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

source

pub fn colors(&self) -> &Settings

Settings for color and style customization ([colors] table).

Parameter Type Description
returns &Settings

Settings::database

source

pub fn database(&self) -> &Settings

Settings for database connectivity ([database] table).

Parameter Type Description
returns &Settings

Settings::log

source

pub fn log(&self) -> &Settings

Settings for log output ([log] table).

Parameter Type Description
returns &Settings

Settings::pager

source

pub fn pager(&self) -> &Settings

Settings for the pager helper ([pager] table).

Parameter Type Description
returns &Settings

Settings::serve

source

pub fn serve(&self) -> &Settings

Settings for the built-in web dashboard ([serve] table).

Parameter Type Description
returns &Settings

Settings::storage

source

pub fn storage(&self) -> &Settings

Settings for data storage locations ([storage] table).

Parameter Type Description
returns &Settings