pub trait AmendState: RecoveryState {
type Checkpoint: Send;
// Required methods
fn staging_available(&self, path: &Path) -> Result<bool, Problem>;
fn same_destination(
&self,
left: &Path,
right: &Path,
) -> Result<bool, Problem>;
fn begin_amend(
&self,
guard: &Self::Admission,
task: &Task,
request: &AmendRequest,
targets: &[RemovalTarget],
) -> Result<Self::Checkpoint, Problem>;
fn removal_targets(
&self,
guard: &Self::Admission,
) -> Result<Vec<RemovalTarget>, Problem>;
fn settle_unlink(
&self,
guard: &Self::Admission,
task: &Task,
target: &RemovalTarget,
) -> Result<(), Problem>;
fn unchanged_amend(
&self,
guard: &Self::Admission,
checkpoint: Self::Checkpoint,
) -> Result<(), Problem>;
fn amend_request(
&self,
guard: &Self::Admission,
) -> Result<Option<AmendRequest>, Problem>;
}Expand description
Persistent intent and checkpoints needed for a resumable amendment.
Required Associated Types§
Sourcetype Checkpoint: Send
type Checkpoint: Send
State saved before amendment effects begin.
Required Methods§
Sourcefn staging_available(&self, path: &Path) -> Result<bool, Problem>
fn staging_available(&self, path: &Path) -> Result<bool, Problem>
May a private staging name be used without adopting an existing entry?
Sourcefn same_destination(&self, left: &Path, right: &Path) -> Result<bool, Problem>
fn same_destination(&self, left: &Path, right: &Path) -> Result<bool, Problem>
Does this sibling spelling identify the same directory on this volume?
Sourcefn begin_amend(
&self,
guard: &Self::Admission,
task: &Task,
request: &AmendRequest,
targets: &[RemovalTarget],
) -> Result<Self::Checkpoint, Problem>
fn begin_amend( &self, guard: &Self::Admission, task: &Task, request: &AmendRequest, targets: &[RemovalTarget], ) -> Result<Self::Checkpoint, Problem>
Record the requested changes and bind their removal targets.
Sourcefn removal_targets(
&self,
guard: &Self::Admission,
) -> Result<Vec<RemovalTarget>, Problem>
fn removal_targets( &self, guard: &Self::Admission, ) -> Result<Vec<RemovalTarget>, Problem>
Read the participants bound to the pending removal.
Sourcefn settle_unlink(
&self,
guard: &Self::Admission,
task: &Task,
target: &RemovalTarget,
) -> Result<(), Problem>
fn settle_unlink( &self, guard: &Self::Admission, task: &Task, target: &RemovalTarget, ) -> Result<(), Problem>
Publish confirmed unlink and compacted membership as a single revision.
Sourcefn unchanged_amend(
&self,
guard: &Self::Admission,
checkpoint: Self::Checkpoint,
) -> Result<(), Problem>
fn unchanged_amend( &self, guard: &Self::Admission, checkpoint: Self::Checkpoint, ) -> Result<(), Problem>
Restore the checkpoint when the amendment produced no effects.
Sourcefn amend_request(
&self,
guard: &Self::Admission,
) -> Result<Option<AmendRequest>, Problem>
fn amend_request( &self, guard: &Self::Admission, ) -> Result<Option<AmendRequest>, Problem>
Read the recorded request for amendment recovery.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".