Struct ParentOptions

Source
#[non_exhaustive]
pub struct ParentOptions { pub group_by: Option<SnapshotGroupCriterion>, pub parent: Option<String>, pub skip_identical_parent: bool, pub force: bool, pub ignore_ctime: bool, pub ignore_inode: bool, }
Expand description

backup subcommand Options how the backup command uses a parent snapshot.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§group_by: Option<SnapshotGroupCriterion>

Group snapshots by any combination of host,label,paths,tags to find a suitable parent (default: host,label,paths)

§parent: Option<String>

Snapshot to use as parent

§skip_identical_parent: bool

Skip writing of snapshot if nothing changed w.r.t. the parent snapshot.

§force: bool

Use no parent, read all files

§ignore_ctime: bool

Ignore ctime changes when checking for modified files

§ignore_inode: bool

Ignore inode number changes when checking for modified files

Implementations§

Source§

impl ParentOptions

Source

pub fn group_by(self, value: impl Into<Option<SnapshotGroupCriterion>>) -> Self

Sets the group_by field of this struct.

Source

pub fn parent(self, value: impl Into<Option<String>>) -> Self

Sets the parent field of this struct.

Source

pub fn skip_identical_parent(self, value: impl Into<bool>) -> Self

Sets the skip_identical_parent field of this struct.

Source

pub fn force(self, value: impl Into<bool>) -> Self

Sets the force field of this struct.

Source

pub fn ignore_ctime(self, value: impl Into<bool>) -> Self

Sets the ignore_ctime field of this struct.

Source

pub fn ignore_inode(self, value: impl Into<bool>) -> Self

Sets the ignore_inode field of this struct.

Source§

impl ParentOptions

Source

pub(crate) fn get_parent<P: ProgressBars, S: IndexedTree>( &self, repo: &Repository<P, S>, snap: &SnapshotFile, backup_stdin: bool, ) -> (Option<SnapshotId>, Parent)

Get parent snapshot.

§Type Parameters
  • P - The type of the progress bars.
  • S - The type of the indexed tree.
§Arguments
  • repo - The repository to use
  • snap - The snapshot to use
  • backup_stdin - Whether the backup is from stdin
§Returns

The parent snapshot id and the parent object or None if no parent is used.

Trait Implementations§

Source§

impl Args for ParentOptions

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

impl Clone for ParentOptions

Source§

fn clone(&self) -> ParentOptions

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CommandFactory for ParentOptions

Source§

fn command<'b>() -> Command

Build a Command that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a Command that can update self. Read more
Source§

impl Debug for ParentOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ParentOptions

Source§

fn default() -> ParentOptions

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ParentOptions

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl FromArgMatches for ParentOptions

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

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>

Assign values from ArgMatches to self.
Source§

impl Merge for ParentOptions

Source§

fn merge(&mut self, other: Self)

Merge another object into this object.
Source§

impl Parser for ParentOptions

Source§

fn parse() -> Self

Parse from std::env::args_os(), exit on error.
Source§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
Source§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error.
Source§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
Source§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error. Read more
Source§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.
Source§

impl Serialize for ParentOptions

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> MergeFrom for T
where T: Merge,

Source§

fn merge_from(self, other: Self) -> Self
where Self: Sized,

Merges two instances of a type into a new instance. Read more
Source§

impl<T> MergePrecedence for T
where T: MergeFrom,

Source§

fn merge_precedence(self, medium: Self, low: Self) -> Self
where Self: Sized,

Merges three instances of a type, with the precedence order being self, medium, and low. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,