pub struct StoreDirectories { /* private fields */ }Expand description
The stores under app_dir, one directory each (E1).
Implementations§
Source§impl StoreDirectories
impl StoreDirectories
Sourcepub fn new(app_dir: PathBuf, bugs: BugSinkRef) -> Self
pub fn new(app_dir: PathBuf, bugs: BugSinkRef) -> Self
The stores under app_dir, one directory each (E1). The app creates
app_dir; coven creates directories only inside it. A bug in work
nobody waits for, in any of the stores, goes to bugs (E15).
Sourcepub fn bugs(&self) -> &BugSinkRef
pub fn bugs(&self) -> &BugSinkRef
Where a bug in work nobody waits for goes, for every store here (E15).
Sourcepub async fn store_ids(&self) -> Result<Vec<StoreId>, FileError>
pub async fn store_ids(&self) -> Result<Vec<StoreId>, FileError>
The stores on this device, ordered by id (E1), including those whose replacement is unfinished, but no unpublished first installation. Only directories with a canonical UUID name and matching valid settings are stores. Invalid entries are logged; filesystem failures are errors.
Sourcepub async fn unfinished_first_installations(
&self,
) -> Result<Vec<StoreId>, FileError>
pub async fn unfinished_first_installations( &self, ) -> Result<Vec<StoreId>, FileError>
The stores whose first installation on this device is unfinished, a
restore or a join that hasn’t loaded, ordered by id (§19.1). A store
whose replacement is unfinished is listed by store_ids instead.
Sourcepub async fn lock_unfinished_first(
&self,
id: StoreId,
) -> Result<Option<StoreDeletionLock>, BootstrapDirectoryError>
pub async fn lock_unfinished_first( &self, id: StoreId, ) -> Result<Option<StoreDeletionLock>, BootstrapDirectoryError>
Lock an unfinished first installation for deletion while no call holds
it: no restore or join, in this process or another, holds its
bootstrap lock, and one closing in this process has been waited for.
None when a call holds it, or it is no longer an unfinished first
installation: published, being replaced, or gone. Whether anything
still refers to it, a join’s saved code or a restore’s record, is for
the caller to read while it holds the lock, since no call can begin on
the installation meanwhile (§13.4, §11.6).
Sourcepub async fn recorded_deletions(&self) -> Result<Vec<StoreId>, FileError>
pub async fn recorded_deletions(&self) -> Result<Vec<StoreId>, FileError>
The stores whose deletion from this device is recorded and unfinished, ordered by id: a directory under its deletion name, or the store’s writer or reader lock file with no directory. A deletion’s first step renames the store’s directory, so either is what a cut deletion leaves (E1).
Sourcepub async fn deletion_recorded(&self, id: StoreId) -> Result<bool, FileError>
pub async fn deletion_recorded(&self, id: StoreId) -> Result<bool, FileError>
Whether the deletion of the store with id is recorded and
unfinished, as recorded_deletions reads it.
Sourcepub fn store_dir(&self, id: &StoreId) -> StoreDir
pub fn store_dir(&self, id: &StoreId) -> StoreDir
The directory of the store with id (E1). This does not create it,
read settings, or acquire the writer’s lock.
Sourcepub fn create_store_dir(
&self,
id: StoreId,
ids: &dyn IdSource,
) -> Result<StoreDir, DirectoryCreationError>
pub fn create_store_dir( &self, id: StoreId, ids: &dyn IdSource, ) -> Result<StoreDir, DirectoryCreationError>
Publish a directory fixture without initializing member custody.
Source§impl StoreDirectories
impl StoreDirectories
Sourcepub async fn begin_bootstrap(
&self,
id: StoreId,
ids: &dyn IdSource,
) -> Result<BootstrapStore, BootstrapDirectoryError>
pub async fn begin_bootstrap( &self, id: StoreId, ids: &dyn IdSource, ) -> Result<BootstrapStore, BootstrapDirectoryError>
Reserve a hidden, restartable new-device store. A second attempt for the
same id waits for a dropped bootstrap’s remaining work to release its
locks; a live bootstrap still refuses it. Ordinary store listings exclude
it until BootstrapStore::publish succeeds.
Sourcepub async fn begin_replacement(
&self,
id: StoreId,
by: ReplacedBy,
ids: &dyn IdSource,
) -> Result<ReplacementStore, BootstrapDirectoryError>
pub async fn begin_replacement( &self, id: StoreId, by: ReplacedBy, ids: &dyn IdSource, ) -> Result<ReplacementStore, BootstrapDirectoryError>
Replace the installation of a published store, or continue a
replacement under way: hold the store’s bootstrap and writer locks, so
no handle opens it meanwhile, and load the new installation in a
hidden directory inside the store’s directory (§19.3). A recorded
replacement continues its load, and a swap under way finishes. One
that the other call began is refused with
StoreLockError::ReplacementUnfinished, changing nothing.
Trait Implementations§
Source§impl Clone for StoreDirectories
impl Clone for StoreDirectories
Source§fn clone(&self) -> StoreDirectories
fn clone(&self) -> StoreDirectories
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more