Skip to main content

Store

Struct Store 

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

Workspace state adapter for admitted task mutations.

Implementations§

Source§

impl Store

Source

pub fn admit(&self, name: &str) -> Result<TaskGuard, Problem>

Acquire operation admission for the named task.

Source

pub fn ensure_new(&self, guard: &TaskGuard, name: &str) -> Result<(), Problem>

Check under admission that the proposed task can be created.

Source§

impl Store

Source

pub fn remember_participant( &self, guard: &TaskGuard, participant: &Participant, ) -> Result<bool, Problem>

Persist the participant’s verified placement hint.

Source§

impl Store

Source

pub fn open_existing( state: &Path, requested_root: Option<&Path>, ) -> Result<Self, Problem>

Open existing workspace state without creating or repairing any files.

Source

pub fn verify(&self) -> Result<(), Problem>

Revalidate the workspace binding before relying on its state.

Source§

impl Store

Source

pub fn begin(&self, guard: &TaskGuard, task: &Task) -> Result<(), Problem>

Publish initial task state while admission is held.

Source

pub fn save(&self, guard: &TaskGuard, task: &Task) -> Result<(), Problem>

Publish updated task state while admission is held.

Source§

impl Store

Source

pub async fn remember_workspace( &self, control: &Control, ) -> Result<bool, Problem>

Record the verified location of the active workspace.

Source

pub async fn edit_project_roots( &self, edit: RootEdit, paths: &[PathBuf], control: &Control, ) -> Result<Vec<PathBuf>, Problem>

Apply the requested root changes to workspace configuration.

Trait Implementations§

Source§

impl AmendState for Store

Source§

type Checkpoint = RevisionCheckpoint

State saved before amendment effects begin.
Source§

fn staging_available(&self, path: &Path) -> Result<bool, Problem>

May a private staging name be used without adopting an existing entry?
Source§

fn same_destination(&self, left: &Path, right: &Path) -> Result<bool, Problem>

Does this sibling spelling identify the same directory on this volume?
Source§

fn begin_amend( &self, guard: &TaskGuard, task: &Task, request: &AmendRequest, targets: &[RemovalTarget], ) -> Result<RevisionCheckpoint, Problem>

Record the requested changes and bind their removal targets.
Source§

fn unchanged_amend( &self, guard: &TaskGuard, checkpoint: RevisionCheckpoint, ) -> Result<(), Problem>

Restore the checkpoint when the amendment produced no effects.
Source§

fn removal_targets( &self, guard: &TaskGuard, ) -> Result<Vec<RemovalTarget>, Problem>

Read the participants bound to the pending removal.
Publish confirmed unlink and compacted membership as a single revision.
Source§

fn amend_request( &self, guard: &TaskGuard, ) -> Result<Option<AmendRequest>, Problem>

Read the recorded request for amendment recovery.
Source§

impl RecoveryState for Store

Source§

fn load(&self, guard: &TaskGuard, name: &str) -> Result<RecoveryRecord, Problem>

Reconstruct the admitted task and its outstanding work.
Source§

impl State for Store

Source§

type Admission = TaskGuard

Guard held while reading or mutating a specific task.
Source§

fn verify(&self) -> Result<(), Problem>

Revalidate the workspace binding before relying on its state.
Source§

fn validate_destination(&self, path: &Path) -> Result<(), Problem>

Check that the proposed workspace path is available.
Source§

fn reserve(&self, path: &Path) -> Result<(), Problem>

Reserve the proposed destination on the filesystem.
Source§

fn admit(&self, name: &str) -> Result<TaskGuard, Problem>

Acquire operation admission for the named task.
Source§

fn ensure_new(&self, admission: &TaskGuard, name: &str) -> Result<(), Problem>

Check under admission that the proposed task can be created.
Source§

fn next_generation(&self, admission: &TaskGuard) -> Result<u64, Problem>

Allocate a fresh incarnation for this task name.
Source§

fn cleanup_retired( &self, admission: &TaskGuard, task: &Task, ) -> Result<(), Problem>

Clean up retained state belonging to the retired incarnation.
Source§

fn record_path(&self, admission: &TaskGuard) -> PathBuf

Return the authoritative document path for the admitted task.
Source§

fn begin(&self, admission: &TaskGuard, task: &Task) -> Result<(), Problem>

Publish initial task state while admission is held.
Source§

fn effect( &self, admission: &TaskGuard, task: &Task, index: usize, settled: bool, ) -> Result<(), Problem>

Compatibility hook for existing state adapters.
Source§

fn save(&self, admission: &TaskGuard, task: &Task) -> Result<(), Problem>

Publish updated task state while admission is held.
Source§

fn record_effect( &self, admission: &Self::Admission, task: &Task, index: usize, state: EffectState, ) -> Result<(), Problem>

Named entry point; delegates to the legacy hook for existing adapters.

Auto Trait Implementations§

§

impl Forget for Store

§

impl Freeze for Store

§

impl Move for Store

§

impl RefUnwindSafe for Store

§

impl Send for Store

§

impl Sync for Store

§

impl Unpin for Store

§

impl UnsafeUnpin for Store

§

impl UnwindSafe for Store

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.