pub struct Staged { /* private fields */ }Expand description
A body written to a sibling temporary file, not yet in place.
The two-phase shape exists so a multi-file install is all-or-nothing at the
only point where that is achievable. Guarding four paths and then writing
four files leaves a window in which the third write fails and the repository
holds two new dispatchers and two old ones — the state bake_repo_hooks’s
own comment claims to prevent and did not. Staging all four first moves
every failure that can be anticipated (no space, no permission, a read-only
directory) BEFORE the first destination is touched.
It is not a transaction and does not pretend to be: commit_all can still
fail on its third rename. What it gives is that the failure is reported with
the exact list of what landed and what did not, instead of a count.