Skip to main content

AmendState

Trait AmendState 

Source
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§

Source

type Checkpoint: Send

State saved before amendment effects begin.

Required Methods§

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: &Self::Admission, task: &Task, request: &AmendRequest, targets: &[RemovalTarget], ) -> Result<Self::Checkpoint, Problem>

Record the requested changes and bind their removal targets.

Source

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

Read the participants bound to the pending removal.

Publish confirmed unlink and compacted membership as a single revision.

Source

fn unchanged_amend( &self, guard: &Self::Admission, checkpoint: Self::Checkpoint, ) -> Result<(), Problem>

Restore the checkpoint when the amendment produced no effects.

Source

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

Implementors§