pub fn get_config_field(
    file_path: Option<&str>,
    file_format: Option<&str>,
    field_name: &str
) -> Result<String, Box<dyn Error>>
Expand description

Retrieves a specific field’s value from a configuration file.

§Arguments

  • file_path - An optional reference to the path of the configuration file.
  • file_format - The format of the configuration file (“json”, “yaml”, or “ini”).
  • field_name - The name of the field to retrieve the value from.

§Returns

Returns a Result<String, Box<dyn std::error::Error>> containing the value of the specified field, or an error if one occurs.