pub trait HistoryAdapter: Send + Sync {
// Required methods
fn provider(&self) -> &str;
fn discover_files(&self) -> Result<Vec<DiscoveredFile>, HistoryError>;
fn extract_meta(
&self,
file_path: &str,
) -> Result<Option<SessionMeta>, HistoryError>;
fn parse_file(
&self,
file_path: &str,
) -> Result<Option<HistorySession>, HistoryError>;
// Provided method
fn discover(&self) -> Result<Discovery, HistoryError> { ... }
}Expand description
One implementation per CLI provider.
Required Methods§
Sourcefn provider(&self) -> &str
fn provider(&self) -> &str
Provider identifier (e.g., “claude”, “codex”, “gemini”, “kimi”, “openclaw”, “pi”).
Sourcefn discover_files(&self) -> Result<Vec<DiscoveredFile>, HistoryError>
fn discover_files(&self) -> Result<Vec<DiscoveredFile>, HistoryError>
Discover all session file paths on disk. Returns (file_path, mtime_ms) pairs, sorted by mtime descending.
Sourcefn extract_meta(
&self,
file_path: &str,
) -> Result<Option<SessionMeta>, HistoryError>
fn extract_meta( &self, file_path: &str, ) -> Result<Option<SessionMeta>, HistoryError>
Extract lightweight metadata without full parsing.
Sourcefn parse_file(
&self,
file_path: &str,
) -> Result<Option<HistorySession>, HistoryError>
fn parse_file( &self, file_path: &str, ) -> Result<Option<HistorySession>, HistoryError>
Parse a single session file into a full HistorySession.
Provided Methods§
Sourcefn discover(&self) -> Result<Discovery, HistoryError>
fn discover(&self) -> Result<Discovery, HistoryError>
Self::discover_files, plus what the walk couldn’t read. An adapter
whose discovery can’t fail part-way keeps this default.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".