pub struct CommitWorkspace {
pub landing: LandingWorkspace,
pub object_directory: PathBuf,
pub hooks_directory: PathBuf,
/* private fields */
}Expand description
What:
The owned state of one transaction.
Why:
The landing reads the LandingWorkspace part; the rest names the places disposal and preparation use.
In TS you’d write (pseudocode):
type CommitTransactionWorkspace = { transactionId; directory; commitIndexPath; capturedIndexPath; shadowPath; objectDirectory; hooksDirectory };Fields§
§landing: LandingWorkspaceThe part the landing attempt reads and marks.
object_directory: PathBufShadow object store receiving every object the transaction writes before landing migrates them.
hooks_directory: PathBufHook dispatcher directory.
Implementations§
Source§impl CommitWorkspace
impl CommitWorkspace
Sourcepub fn finish_transaction(&mut self)
pub fn finish_transaction(&mut self)
What:
Mark durable completion, so disposal removes the recovery artifacts.
Why:
After the landed commit’s cleanup the landing’s preserved mark no longer protects anything.
In TS you’d write (pseudocode):
workspace.finishTransaction();Sourcepub fn dispose(&mut self) -> Result<(), RecoveryError>
pub fn dispose(&mut self) -> Result<(), RecoveryError>
What: Remove the shadow repository, then the directory, then prune landed captures, unless recovery owns them. Why: Later calls do nothing, and a failed removal is reported while the directory stays for recovery.
In TS you’d write (pseudocode):
await workspace[Symbol.asyncDispose]();Sourcepub fn git_dir(&self) -> &Path
pub fn git_dir(&self) -> &Path
What: The Git directory of the owning worktree. Why: Post-landing completion prunes the capture store there.
In TS you’d write (pseudocode):
capture.gitDirSourcepub fn registry_root(&self) -> &Path
pub fn registry_root(&self) -> &Path
What: The transaction registry root. Why: Post-landing completion and the reservation read it.
In TS you’d write (pseudocode):
capture.registryRootSourcepub fn mark_disposed(&mut self)
pub fn mark_disposed(&mut self)
What: Hand the disposal to a later step, which has already removed what the workspace owns. Why: The post-landing completion removes the shadow and the directory itself, so the drop must not repeat it.
In TS you’d write (pseudocode):
workspace.finishTransaction(); await workspace[Symbol.asyncDispose]();Trait Implementations§
Source§impl Debug for CommitWorkspace
impl Debug for CommitWorkspace
Auto Trait Implementations§
impl Freeze for CommitWorkspace
impl RefUnwindSafe for CommitWorkspace
impl Send for CommitWorkspace
impl Sync for CommitWorkspace
impl Unpin for CommitWorkspace
impl UnsafeUnpin for CommitWorkspace
impl UnwindSafe for CommitWorkspace
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more