Crate xvc_config

Source
Expand description

Provides a general solution to maintain configuration spanned across different sources.

  • Default Values
  • System configuration
  • User configuration
  • Public project configuration (tracked by Git)
  • Private (local) project configuration (not tracked by Git)
  • Environment variables
  • Command line options

The configuration keys are string. Configuration values can be:

  • string
  • bool
  • int
  • float

Configuration files are in TOML.

Options can be nested like group.name = value.

Each option can be tracked to its source via XvcConfigOption.

Re-exports§

pub use config_params::XvcConfigParams;

Modules§

config_params
Specify configuration sources
error
Error types for the config crate.

Macros§

conf
Binds a type with a configuration key.

Structs§

SYSTEM_CONFIG_DIRS
System specific configuration directory. see directories_next::ProjectDirs.
USER_CONFIG_DIRS
User configuration directories. See directories_next::BaseDirs.
USER_DIRS
User directories. see directories_next::UserDirs.
XvcConfig
Keeps track of all Xvc configuration.
XvcConfigMap
A set of options defined as a TOML document from a single XvcConfigOptionSource
XvcConfigOption
The option and its source.
XvcConfigValue
A configuration value with its source

Enums§

XvcConfigOptionSource
Define the source where an option is obtained
XvcVerbosity
Verbosity levels for Xvc CLI

Traits§

FromConfigKey
A struct implementing this trait can instantiate itself from XvcConfig.
UpdateFromXvcConfig
Trait to update CLI options with defaults from configuration.

Functions§

toml_value_to_hashmap
Convert a TomlValue which can be a TomlValue::Table or any other simple type to a hash map with keys in the hierarchical form.