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.
- XvcConfig
Map - A set of options defined as a TOML document from a single XvcConfigOptionSource
- XvcConfig
Option - The option and its source.
- XvcConfig
Value - A configuration value with its source
Enums§
- XvcConfig
Option Source - Define the source where an option is obtained
- XvcVerbosity
- Verbosity levels for Xvc CLI
Traits§
- From
Config Key - A struct implementing this trait can instantiate itself from XvcConfig.
- Update
From XvcConfig - 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.