pub trait MetadataStore:
Send
+ Sync
+ 'static {
Show 14 methods
// Required methods
fn register_repo(&self, repo_path: PathBuf) -> StorageResult<RepoMetadata>;
fn unregister_repo(
&self,
repo_path: &Path,
) -> StorageResult<Option<RepoMetadata>>;
fn get_repo(&self, repo_path: &Path) -> StorageResult<Option<RepoMetadata>>;
fn list_repos(&self) -> StorageResult<Vec<RepoMetadata>>;
fn update_repo_status(
&self,
repo_path: &Path,
status: RepoStatus,
) -> StorageResult<()>;
fn increment_jobs(
&self,
repo_path: &Path,
delta: isize,
) -> StorageResult<RepoMetadata>;
fn record_event(
&self,
repo_path: &Path,
when: SystemTime,
) -> StorageResult<()>;
fn mark_dirty_path(
&self,
repo_path: &Path,
path: PathBuf,
) -> StorageResult<()>;
fn drain_dirty_paths(&self, repo_path: &Path) -> StorageResult<Vec<PathBuf>>;
fn dirty_path_count(&self, repo_path: &Path) -> StorageResult<usize>;
fn current_generation(&self, repo_path: &Path) -> StorageResult<u64>;
fn bump_generation(&self, repo_path: &Path) -> StorageResult<u64>;
fn set_needs_reconciliation(
&self,
repo_path: &Path,
needs: bool,
) -> StorageResult<()>;
fn set_watcher_token(
&self,
repo_path: &Path,
token: u64,
) -> StorageResult<()>;
}Expand description
Primary abstraction for storing repository metadata.