Skip to main content

apply_all

Function apply_all 

Source
pub fn apply_all(
    target: &Utf8Path,
    plans: &[Plan],
) -> Result<Vec<Utf8PathBuf>, AppError>
Expand description

Carry out every plan as one transaction, and report the files written.

Every destination and the manifest are checked to stay inside the target before a byte lands, every existing file is backed up, each specification is written atomically and re-read to confirm it defines its sentinel, and the manifest is written last with every record moved at once. Any failure restores every path this call touched, so the operator never holds an adopted file the record does not describe, or one plan applied and another not.

ยงErrors

AppError::Refused for a checklist plan, a destination that leaves the target, or a rewrite that does not define its sentinel, and manifest and I/O errors when the tree cannot be read or written. The target is restored before any of these returns.