Struct rustic_core::ConfigOptions

source ·
pub struct ConfigOptions {
    pub set_compression: Option<i32>,
    pub set_version: Option<u32>,
    pub set_append_only: Option<bool>,
    pub set_treepack_size: Option<ByteSize>,
    pub set_treepack_size_limit: Option<ByteSize>,
    pub set_treepack_growfactor: Option<u32>,
    pub set_datapack_size: Option<ByteSize>,
    pub set_datapack_growfactor: Option<u32>,
    pub set_datapack_size_limit: Option<ByteSize>,
    pub set_min_packsize_tolerate_percent: Option<u32>,
    pub set_max_packsize_tolerate_percent: Option<u32>,
    pub set_extra_verify: Option<bool>,
}
Expand description

Options for the config command, used to set repository-wide options

Fields§

§set_compression: Option<i32>

Set compression level. Allowed levels are 1 to 22 and -1 to -7, see https://facebook.github.io/zstd/. Note that 0 equals to no compression

§set_version: Option<u32>

Set repository version. Allowed versions: 1,2

§set_append_only: Option<bool>

Set append-only mode. Note that only append-only commands work once this is set. forget, prune or config won’t work any longer.

§set_treepack_size: Option<ByteSize>

Set default packsize for tree packs. rustic tries to always produce packs greater than this value. Note that for large repos, this value is grown by the grown factor. Defaults to 4 MiB if not set.

§set_treepack_size_limit: Option<ByteSize>

Set upper limit for default packsize for tree packs. Note that packs actually can get a bit larger. If not set, pack sizes can grow up to approximately 4 GiB.

§set_treepack_growfactor: Option<u32>

Set grow factor for tree packs. The default packsize grows by the square root of the total size of all tree packs multiplied with this factor. This means 32 kiB times this factor per square root of total treesize in GiB. Defaults to 32 (= 1MB per square root of total treesize in GiB) if not set.

§set_datapack_size: Option<ByteSize>

Set default packsize for data packs. rustic tries to always produce packs greater than this value. Note that for large repos, this value is grown by the grown factor. Defaults to 32 MiB if not set.

§set_datapack_growfactor: Option<u32>

Set grow factor for data packs. The default packsize grows by the square root of the total size of all data packs multiplied with this factor. This means 32 kiB times this factor per square root of total datasize in GiB. Defaults to 32 (= 1MB per square root of total datasize in GiB) if not set.

§set_datapack_size_limit: Option<ByteSize>

Set upper limit for default packsize for tree packs. Note that packs actually can get a bit larger. If not set, pack sizes can grow up to approximately 4 GiB.

§set_min_packsize_tolerate_percent: Option<u32>

Set minimum tolerated packsize in percent of the targeted packsize. Defaults to 30 if not set.

§set_max_packsize_tolerate_percent: Option<u32>

Set maximum tolerated packsize in percent of the targeted packsize A value of 0 means packs larger than the targeted packsize are always tolerated. Default if not set: larger packfiles are always tolerated.

§set_extra_verify: Option<bool>

Do an extra verification by decompressing/decrypting all data before uploading to the repository. Default: true

Implementations§

source§

impl ConfigOptions

source

pub fn set_compression(self, value: impl Into<Option<i32>>) -> Self

Sets the set_compression field of this struct.

source

pub fn set_version(self, value: impl Into<Option<u32>>) -> Self

Sets the set_version field of this struct.

source

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

Sets the set_append_only field of this struct.

source

pub fn set_treepack_size(self, value: impl Into<Option<ByteSize>>) -> Self

Sets the set_treepack_size field of this struct.

source

pub fn set_treepack_size_limit(self, value: impl Into<Option<ByteSize>>) -> Self

Sets the set_treepack_size_limit field of this struct.

source

pub fn set_treepack_growfactor(self, value: impl Into<Option<u32>>) -> Self

Sets the set_treepack_growfactor field of this struct.

source

pub fn set_datapack_size(self, value: impl Into<Option<ByteSize>>) -> Self

Sets the set_datapack_size field of this struct.

source

pub fn set_datapack_growfactor(self, value: impl Into<Option<u32>>) -> Self

Sets the set_datapack_growfactor field of this struct.

source

pub fn set_datapack_size_limit(self, value: impl Into<Option<ByteSize>>) -> Self

Sets the set_datapack_size_limit field of this struct.

source

pub fn set_min_packsize_tolerate_percent( self, value: impl Into<Option<u32>>, ) -> Self

Sets the set_min_packsize_tolerate_percent field of this struct.

source

pub fn set_max_packsize_tolerate_percent( self, value: impl Into<Option<u32>>, ) -> Self

Sets the set_max_packsize_tolerate_percent field of this struct.

source

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

Sets the set_extra_verify field of this struct.

source§

impl ConfigOptions

source

pub fn apply(&self, config: &mut ConfigFile) -> RusticResult<()>

Apply the ConfigOptions to a given ConfigFile

§Arguments
  • config - The config to apply the options to
§Errors

Trait Implementations§

source§

impl Args for ConfigOptions

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. Read more
source§

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

Append to Command so it can update self. Read more
source§

impl Clone for ConfigOptions

source§

fn clone(&self) -> ConfigOptions

Returns a copy 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 ConfigOptions

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 ConfigOptions

source§

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

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

impl Default for ConfigOptions

source§

fn default() -> ConfigOptions

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

impl FromArgMatches for ConfigOptions

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 Parser for ConfigOptions

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.
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 Copy for ConfigOptions

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

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

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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>,

§

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