Skip to main content

load_toml_file

Function load_toml_file 

Source
pub fn load_toml_file(
    path: Option<&Path>,
) -> Result<Option<Table>, SettingsError>
Expand description

Loads an optional TOML config file into a table.

Returns Ok(None) when path is None or when the file does not exist. Returns Ok(Some(table)) when the file exists and parses successfully.

ยงErrors

Returns SettingsError::ConfigRead when the file exists but cannot be read. Returns SettingsError::ConfigParse when the file contents are not valid TOML.