pub trait SessionRepo {
// Required methods
fn list(
&self,
session_dir: &Path,
filter_cwd: Option<&Path>,
progress: Option<&dyn Fn(usize, usize)>,
) -> Vec<SessionInfo>;
fn list_all(
&self,
progress: Option<&dyn Fn(usize, usize)>,
) -> Vec<SessionInfo>;
fn delete(&self, path: &Path) -> Result<()>;
fn fork(
&self,
source_path: &Path,
target_dir: &Path,
entry_id: Option<&str>,
position: Option<&str>,
) -> Result<String>;
fn load_info(&self, path: &Path) -> Option<SessionInfo>;
}Expand description
Session lifecycle management: create, open, list, delete, fork.
Default implementation uses JSONL files on disk.
Required Methods§
Sourcefn list(
&self,
session_dir: &Path,
filter_cwd: Option<&Path>,
progress: Option<&dyn Fn(usize, usize)>,
) -> Vec<SessionInfo>
fn list( &self, session_dir: &Path, filter_cwd: Option<&Path>, progress: Option<&dyn Fn(usize, usize)>, ) -> Vec<SessionInfo>
List sessions in a directory, optionally filtered by cwd.
progress receives (loaded_count, total_count) for UI updates.
Sourcefn list_all(&self, progress: Option<&dyn Fn(usize, usize)>) -> Vec<SessionInfo>
fn list_all(&self, progress: Option<&dyn Fn(usize, usize)>) -> Vec<SessionInfo>
List sessions across all project directories under ~/.rab/sessions/.
Sourcefn fork(
&self,
source_path: &Path,
target_dir: &Path,
entry_id: Option<&str>,
position: Option<&str>,
) -> Result<String>
fn fork( &self, source_path: &Path, target_dir: &Path, entry_id: Option<&str>, position: Option<&str>, ) -> Result<String>
Fork a session: create a new session file containing entries up to (and including) the given entry_id, or all entries if entry_id is None.
Sourcefn load_info(&self, path: &Path) -> Option<SessionInfo>
fn load_info(&self, path: &Path) -> Option<SessionInfo>
Load metadata for a single session file.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".