Create a new file session store Creates the directory if it doesn't exist.
(dir: P)
| 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 { |
nothing calls this directly
no test coverage detected