MCPcopy Create free account
hub / github.com/AI45Lab/Code / new

Method new

core/src/store/file_store.rs:35–44  ·  view source on GitHub ↗

Create a new file session store Creates the directory if it doesn't exist.

(dir: P)

Source from the content-addressed store, hash-verified

33 ///
34 /// Creates the directory if it doesn't exist.
35 pub async fn new<P: AsRef<Path>>(dir: P) -> Result<Self> {
36 let dir = dir.as_ref().to_path_buf();
37
38 // Create directory if it doesn't exist
39 fs::create_dir_all(&dir)
40 .await
41 .with_context(|| format!("Failed to create session directory: {}", dir.display()))?;
42
43 Ok(Self { dir })
44 }
45
46 /// Get the file path for a session
47 fn session_path(&self, id: &str) -> PathBuf {

Callers

nothing calls this directly

Calls 1

with_contextMethod · 0.80

Tested by

no test coverage detected