pub trait IndexStorage: Send + Sync {
// Required methods
fn init(&self, index_dir: &Path) -> Result<()>;
fn persist(&self, index_dir: &Path, entry: &FileIndex) -> Result<()>;
// Provided methods
fn prefers_snapshot_persistence(&self) -> bool { ... }
fn remove(&self, _index_dir: &Path, _file_path: &Path) -> Result<()> { ... }
fn persist_batch(
&self,
index_dir: &Path,
entries: &[FileIndex],
) -> Result<()> { ... }
}Expand description
Persistence backend for SimpleIndexer.
Required Methods§
Provided Methods§
Sourcefn prefers_snapshot_persistence(&self) -> bool
fn prefers_snapshot_persistence(&self) -> bool
Whether this backend expects full-snapshot persistence.
Snapshot-aware backends receive the complete in-memory index on each update so on-disk state stays consistent across single-file and directory indexing flows.
Sourcefn remove(&self, _index_dir: &Path, _file_path: &Path) -> Result<()>
fn remove(&self, _index_dir: &Path, _file_path: &Path) -> Result<()>
Remove a previously persisted file entry.
Defaults to a no-op to keep existing custom storage backends compatible.
Sourcefn persist_batch(&self, index_dir: &Path, entries: &[FileIndex]) -> Result<()>
fn persist_batch(&self, index_dir: &Path, entries: &[FileIndex]) -> Result<()>
Persist a batch of indexed file entries.
Defaults to calling IndexStorage::persist for each entry, keeping
existing custom storage backends compatible.