harbor run -t openthoughts/tasktrove-exp-rpt-stack-rust-v2-stack-rust-3321harbor download openthoughts/tasktrove-exp-rpt-stack-rust-v2-stack-rust-3321Implement the configuration loading functionality for a text editor in Rust with the following requirements:
Configuration Structure:
Config to store the following configuration parameters:
tab_stop: A usize indicating the number of spaces for a tab (must be > 0).quit_times: A usize representing the number of confirmations needed before quitting when changes have been made.message_dur: A Duration indicating how long messages are displayed in the status bar.show_line_num: A bool indicating whether to display line numbers.Default Implementation:
Default trait for the Config struct that initializes tab_stop to 4, quit_times to 2, message_dur to 3 seconds, and show_line_num to true.INI File Processing:
process_ini_file that reads an INI file and processes it using a callback function. The callback should handle key-value pairs for the following configuration keys:
tab_stop (must parse to a non-zero usize)quit_times (parses to a usize)message_duration (parses to a f32, and is converted to a Duration)show_line_numbers (parses to a bool)Error Handling:
tab_stop is set to 0.=).Load Functionality:
load in the Config struct that:
process_ini_file to load configurations from INI files located in the following paths:
/etc/kibi (system-wide configuration).$XDG_CONFIG_HOME or $HOME/.config/kibi (for Linux and macOS).%APPDATA%\Kibi (for Windows).Testing:
Place your implementation in the /app/ directory.