harbor run -t openthoughts/tasktrove-exp-rpt-stack-rust-v2-stack-rust-4777harbor download openthoughts/tasktrove-exp-rpt-stack-rust-v2-stack-rust-4777Implement the functionality for handling project configuration in the Rust application located in the /app/ directory. Specifically, you need to complete the following goals:
Config Structure Implementation: Ensure that the Config struct represents the expected configuration schema, including fields for connection, auth_info, request_type, packages, last_update, and ignore_certs.
Saving Configuration: Create a function save_config that saves a given configuration to a specified file path. The saving procedure must:
serde_yaml.Parsing Configuration: Implement the parse_config function that reads a YAML configuration file from a specified path and deserializes it into the Config struct.
Reading Configuration: Create a function read_configuration that reads the project configuration from a specified path and allows overriding the offline_access field of auth_info with an API key found in the environment variable PHYLUM_API_KEY, if it is set.
Finding Project Configuration: Implement the function find_project_conf to search for the .phylum_project configuration file starting from a given directory and moving upwards through the directory tree, up to a maximum depth of 32 directories.
Retrieving Current Project: Develop the function get_current_project to retrieve and parse the current project’s configuration, logging the path where the configuration file was found.
Home Settings Path Retrieval: Implement get_home_settings_path to construct and return the path to the user's home directory settings YAML file located at ~/.phylum/settings.yaml.
Testing: Ensure that the functions are properly tested using the provided test cases. Specifically, the functions save_config and parse_config should be verified to run without errors and produce the expected outcomes.
Make sure your implementation is clearly documented, handles errors appropriately, and follows best practices for Rust development.