Struct rustic_core::RestoreOptions
source · pub struct RestoreOptions {
pub delete: bool,
pub numeric_id: bool,
pub no_ownership: bool,
pub verify_existing: bool,
}Expand description
Options for the restore command
Fields§
§delete: boolRemove all files/dirs in destination which are not contained in snapshot.
§Warning
Use with care, maybe first try this with –dry-run?
numeric_id: boolUse numeric ids instead of user/group when restoring uid/gui
no_ownership: boolDon’t restore ownership (user/group)
verify_existing: boolAlways read and verify existing files (don’t trust correct modification time and file size)
Implementations§
source§impl RestoreOptions
impl RestoreOptions
sourcepub fn numeric_id(self, value: impl Into<bool>) -> Self
pub fn numeric_id(self, value: impl Into<bool>) -> Self
Sets the numeric_id field of this struct.
sourcepub fn no_ownership(self, value: impl Into<bool>) -> Self
pub fn no_ownership(self, value: impl Into<bool>) -> Self
Sets the no_ownership field of this struct.
sourcepub fn verify_existing(self, value: impl Into<bool>) -> Self
pub fn verify_existing(self, value: impl Into<bool>) -> Self
Sets the verify_existing field of this struct.
source§impl RestoreOptions
impl RestoreOptions
sourcepub(crate) fn restore<P: ProgressBars, S: IndexedTree>(
self,
file_infos: RestorePlan,
repo: &Repository<P, S>,
node_streamer: impl Iterator<Item = RusticResult<(PathBuf, Node)>>,
dest: &LocalDestination,
) -> RusticResult<()>
pub(crate) fn restore<P: ProgressBars, S: IndexedTree>( self, file_infos: RestorePlan, repo: &Repository<P, S>, node_streamer: impl Iterator<Item = RusticResult<(PathBuf, Node)>>, dest: &LocalDestination, ) -> RusticResult<()>
Restore the repository to the given destination.
§Type Parameters
P- The progress bar type.S- The type of the indexed tree.
§Arguments
file_infos- The restore information.repo- The repository to restore.node_streamer- The node streamer to use.dest- The destination to restore to.
§Errors
If the restore failed.
sourcepub(crate) fn collect_and_prepare<P: ProgressBars, S: IndexedFull>(
self,
repo: &Repository<P, S>,
node_streamer: impl Iterator<Item = RusticResult<(PathBuf, Node)>>,
dest: &LocalDestination,
dry_run: bool,
) -> RusticResult<RestorePlan>
pub(crate) fn collect_and_prepare<P: ProgressBars, S: IndexedFull>( self, repo: &Repository<P, S>, node_streamer: impl Iterator<Item = RusticResult<(PathBuf, Node)>>, dest: &LocalDestination, dry_run: bool, ) -> RusticResult<RestorePlan>
Collect restore information, scan existing files, create needed dirs and remove superfluous files
§Type Parameters
P- The progress bar type.S- The type of the indexed tree.
§Arguments
repo- The repository to restore.node_streamer- The node streamer to use.dest- The destination to restore to.dry_run- If true, don’t actually restore anything, but only print out what would be done.
§Errors
CommandErrorKind::ErrorCreating- If a directory could not be created.CommandErrorKind::ErrorCollecting- If the restore information could not be collected.
sourcefn restore_metadata(
self,
node_streamer: impl Iterator<Item = RusticResult<(PathBuf, Node)>>,
dest: &LocalDestination,
) -> RusticResult<()>
fn restore_metadata( self, node_streamer: impl Iterator<Item = RusticResult<(PathBuf, Node)>>, dest: &LocalDestination, ) -> RusticResult<()>
sourcefn set_metadata(self, dest: &LocalDestination, path: &PathBuf, node: &Node)
fn set_metadata(self, dest: &LocalDestination, path: &PathBuf, node: &Node)
Trait Implementations§
source§impl Args for RestoreOptions
impl Args for RestoreOptions
source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
source§impl Clone for RestoreOptions
impl Clone for RestoreOptions
source§fn clone(&self) -> RestoreOptions
fn clone(&self) -> RestoreOptions
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl CommandFactory for RestoreOptions
impl CommandFactory for RestoreOptions
source§impl Debug for RestoreOptions
impl Debug for RestoreOptions
source§impl Default for RestoreOptions
impl Default for RestoreOptions
source§fn default() -> RestoreOptions
fn default() -> RestoreOptions
Returns the “default value” for a type. Read more
source§impl FromArgMatches for RestoreOptions
impl FromArgMatches for RestoreOptions
source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.source§impl Parser for RestoreOptions
impl Parser for RestoreOptions
source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Parse from iterator, exit on error.
source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Parse from iterator, return Err on error.
source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Update from iterator, exit on error.
impl Copy for RestoreOptions
Auto Trait Implementations§
impl Freeze for RestoreOptions
impl RefUnwindSafe for RestoreOptions
impl Send for RestoreOptions
impl Sync for RestoreOptions
impl Unpin for RestoreOptions
impl UnwindSafe for RestoreOptions
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more