MCPcopy Create free account
hub / github.com/CodeBendKit/codeseek / save_graph

Method save_graph

rust-core/src/storage/persistence.rs:60–78  ·  view source on GitHub ↗
(&self, project_id: &str, graph: &PetCodeGraph)

Source from the content-addressed store, hash-verified

58 }
59
60 pub fn save_graph(&self, project_id: &str, graph: &PetCodeGraph) -> io::Result<()> {
61 let project_dir = self.project_dir(project_id);
62 fs::create_dir_all(&project_dir)?;
63
64 match self.storage_mode {
65 StorageMode::Json => {
66 self.save_graph_json(project_id, graph)?;
67 },
68 StorageMode::Binary => {
69 self.save_graph_binary(project_id, graph)?;
70 },
71 StorageMode::Both => {
72 self.save_graph_json(project_id, graph)?;
73 self.save_graph_binary(project_id, graph)?;
74 },
75 }
76
77 Ok(())
78 }
79
80 fn save_graph_json(&self, project_id: &str, graph: &PetCodeGraph) -> io::Result<()> {
81 let project_dir = self.project_dir(project_id);

Callers 3

mainFunction · 0.80

Calls 3

project_dirMethod · 0.80
save_graph_jsonMethod · 0.80
save_graph_binaryMethod · 0.80