pub struct Settings {
pub daemon: DaemonSettings,
pub reclustering: ReclusterSettings,
pub tui: TuiSettings,
}Fields§
§daemon: DaemonSettingsGeneral Daemon Settings
reclustering: ReclusterSettingsParameters for the reclustering algorithm.
tui: TuiSettingsSettings for the TUI
Implementations§
Source§impl Settings
impl Settings
Sourcepub fn init(
config: PathBuf,
port: Option<u16>,
log_level: Option<LevelFilter>,
) -> Result<Self, ConfigError>
pub fn init( config: PathBuf, port: Option<u16>, log_level: Option<LevelFilter>, ) -> Result<Self, ConfigError>
Load settings from the config file, environment variables, and CLI arguments.
The config file is located at the path specified by the --config flag.
The environment variables are prefixed with MECOMP_.
§Arguments
flags- The parsed CLI arguments.
§Errors
This function will return an error if the config file is not found or if the config file is invalid.
Sourcepub fn get_config_path() -> Result<PathBuf, Error>
pub fn get_config_path() -> Result<PathBuf, Error>
Get the (default) path to the config file. If the config file does not exist at this path, it will be created with the default config.
See crate::get_config_dir for more information about where this default path is located.
§Errors
This function will return an error if the system config directory (e.g., ~/.config on linux) could not be found, or if the config file was missing and could not be created.