Skip to main content

StoreDirectories

Struct StoreDirectories 

Source
pub struct StoreDirectories { /* private fields */ }
Expand description

The stores under app_dir, one directory each (E1).

Implementations§

Source§

impl StoreDirectories

Source

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).

Source

pub fn bugs(&self) -> &BugSinkRef

Where a bug in work nobody waits for goes, for every store here (E15).

Source

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.

Source

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.

Source

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).

Source

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).

Source

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.

Source

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.

Source

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

Source

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.

Source

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

Source§

fn clone(&self) -> StoreDirectories

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StoreDirectories

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,