pub struct RestoreOptions {
pub archive: PathBuf,
pub dest: PathBuf,
pub force: bool,
pub dry_run: bool,
}Expand description
Inputs for restore.
Fields§
§archive: PathBufArchive to restore.
dest: PathBufDirectory to create and unpack into.
force: boolUnpack into dest even if it already exists.
This overwrites, it does not wipe: entries in the pack replace their
counterparts in dest, and files already there that the pack does not
contain are left untouched. Restoring over a working copy therefore
recovers everything the pack holds without deleting anything it does
not know about — at the cost of leaving unrelated leftovers in place.
dry_run: boolPredict the restore and report it, writing nothing.
A restore has consequences a listing of the archive cannot show: which files in the destination would be overwritten, which would survive untouched, which symlinks would land dangling on this machine, and which worktree pointers would be rewritten. A dry run answers those before the first byte is written.
An existing destination is not an error during a dry run — reporting
what would collide is precisely the point — so force is not required
to preview one.
Implementations§
Trait Implementations§
Source§impl Clone for RestoreOptions
impl Clone for RestoreOptions
Source§fn clone(&self) -> RestoreOptions
fn clone(&self) -> RestoreOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more