(&self, project_id: &str, graph: &PetCodeGraph)
| 88 | } |
| 89 | |
| 90 | fn save_graph_binary(&self, project_id: &str, graph: &PetCodeGraph) -> io::Result<()> { |
| 91 | let project_dir = self.project_dir(project_id); |
| 92 | let graph_file = project_dir.join("graph.bin"); |
| 93 | |
| 94 | PetGraphStorageManager::save_to_binary(graph, &graph_file) |
| 95 | .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?; |
| 96 | |
| 97 | Ok(()) |
| 98 | } |
| 99 | |
| 100 | pub fn load_graph(&self, project_id: &str) -> io::Result<Option<PetCodeGraph>> { |
| 101 | match self.storage_mode { |