Crate ogre_config_meld

Crate ogre_config_meld 

Source

Re-exports§

pub use clap;
pub use encryptable_tokio_fs;

Enums§

Error
Error variants for the cli-configs trait

Traits§

CmdLineAndConfigIntegration
Trait to allow merging command line options into the application’s configs
OgreRootConfig
Trait to be implemented by root config types, enabling them to be written / loaded from disk

Functions§

documented_config_models
Gives access to the configuration documentation, so they may be included when saving config files, for a better user experience
get_config_file_path
Determines the exact path for the configuration file to be used, taking into account:
load_from_file
Attempts to read & parse the configuration from the given config_file_path. Returns Ok(None) if the file doesn’t exist. See also the higher level load_or_create_default().
load_or_create_default
Loads the configuration from the given config_file_path or creates it (with default values & comments) if it doesn’t exist. See also the low level load_from_file() and save_to_file().
merge_cmdline_args_with_configs
Returns the “effective configuration” applications should use: given the specific root_config and cmdline_options, merge the former into the latter
parse_cmdline_and_merge_with_loaded_configs
Similarly to parse_cmdline_args(), parse the CLI options from the program’s command line args, but also load the configs and merge_cmdline_args_with_configs(), then return the effective configuration the application must use
parse_cmdline_args
Parse the CLI options from the program’s command line args. Most likely you’d like to use [parse_cmdline_and_merge_with_configs()]
save_to_file
Saves the config to config_file_path, including the given tail_documentation at the end of the file (maybe gathered from the original [config_model] sources). See also the higher level load_or_create_default().