pub struct Committer { /* private fields */ }Expand description
Capability-rooted workspace snapshot, revalidation, commit, and recovery engine.
Implementations§
Source§impl Committer
impl Committer
Sourcepub fn open(
workspace_root: impl AsRef<Path>,
blobs: BlobStore,
config: CommitConfig,
) -> Result<Self, CommitError>
pub fn open( workspace_root: impl AsRef<Path>, blobs: BlobStore, config: CommitConfig, ) -> Result<Self, CommitError>
Open one ambient workspace boundary and create its protected runtime directory.
§Errors
Returns an error if the root cannot be opened or a reserved internal path is not a real directory.
Sourcepub fn open_with_workspace_data(
workspace_root: impl AsRef<Path>,
config: CommitConfig,
) -> Result<(Self, DataDirectory), CommitError>
pub fn open_with_workspace_data( workspace_root: impl AsRef<Path>, config: CommitConfig, ) -> Result<(Self, DataDirectory), CommitError>
Open one workspace and derive its committer and durable data store from the
same pinned .vsh-runtime directory capability.
§Errors
Returns an error if any protected directory, coordination file, or blob store cannot be created and verified without following a workspace symlink.
Sourcepub fn artifact_store(&self) -> BlobStore
pub fn artifact_store(&self) -> BlobStore
Return a cheap handle to the immutable artifact store owned by this committer.
Sourcepub const fn config(&self) -> CommitConfig
pub const fn config(&self) -> CommitConfig
Return immutable commit bounds.
Sourcepub fn snapshot(
&self,
limits: SnapshotLimits,
) -> Result<BaseSnapshot, CommitError>
pub fn snapshot( &self, limits: SnapshotLimits, ) -> Result<BaseSnapshot, CommitError>
Capture an eager-metadata, lazy-content snapshot below the workspace capability.
§Errors
Returns an error for unsupported nodes, unstable enumeration, or a size bound.
Sourcepub fn revalidate(
&self,
plan: &CommitPlan<'_>,
) -> Result<Vec<RevalidationConflict>, CommitError>
pub fn revalidate( &self, plan: &CommitPlan<'_>, ) -> Result<Vec<RevalidationConflict>, CommitError>
Revalidate exactly the artifact’s ReadSet and WriteSet without mutating the host.
§Errors
Returns an error when safe host observation fails or bounds are exceeded.
Sourcepub fn commit<S: TransactionStore + ?Sized>(
&self,
store: &S,
reservation: CommitReservation,
plan: &CommitPlan<'_>,
) -> Result<CommitReceipt, CommitError>
pub fn commit<S: TransactionStore + ?Sized>( &self, store: &S, reservation: CommitReservation, plan: &CommitPlan<'_>, ) -> Result<CommitReceipt, CommitError>
Consume a reservation and commit one exact artifact with production fault policy.
§Errors
Returns a stale, binding, I/O, or recovery-required error. Once mutation begins, failures preserve durable recovery obligations.
Sourcepub fn commit_with_faults<S, F>(
&self,
store: &S,
reservation: CommitReservation,
plan: &CommitPlan<'_>,
faults: &F,
) -> Result<CommitReceipt, CommitError>
pub fn commit_with_faults<S, F>( &self, store: &S, reservation: CommitReservation, plan: &CommitPlan<'_>, faults: &F, ) -> Result<CommitReceipt, CommitError>
Commit with an explicit durable-boundary fault injector.
This is public so downstream crash harnesses can validate filesystem/platform behavior without private hooks.
§Errors
Returns the same errors as Self::commit, plus injected failures.
Sourcepub fn recover<S: TransactionStore + ?Sized>(
&self,
store: &S,
) -> Result<RecoveryReport, CommitError>
pub fn recover<S: TransactionStore + ?Sized>( &self, store: &S, ) -> Result<RecoveryReport, CommitError>
Recover every durable transaction workspace under this capability root.
Completed-marker transactions are finalized; interrupted ones are rolled back in reverse order. Ambiguous ownership is reported and never deleted.
§Errors
Returns an error for corrupt journals, unsafe state transitions, or host I/O.