Function read_json_file

Source
pub fn read_json_file(
    file_path: &str,
) -> Result<Vec<Interactor>, Box<dyn Error>>
Expand description

Reads and processes a JSON file containing Interactor data.

This function reads a JSON file, deserializes it into a vector of Interactors, and updates the file paths for any structures referenced in the Interactors.

§Arguments

  • file_path - A string slice that holds the path to the JSON file.

§Returns

  • Ok(Vec<Interactor>) - A vector of Interactor objects if successful.
  • Err(Box<dyn std::error::Error>) - An error if file reading or JSON parsing fails.