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
impl ConfigOptions
sourcepub fn set_compression(self, value: impl Into<Option<i32>>) -> Self
pub fn set_compression(self, value: impl Into<Option<i32>>) -> Self
Sets the set_compression field of this struct.
sourcepub fn set_version(self, value: impl Into<Option<u32>>) -> Self
pub fn set_version(self, value: impl Into<Option<u32>>) -> Self
Sets the set_version field of this struct.
sourcepub fn set_append_only(self, value: impl Into<Option<bool>>) -> Self
pub fn set_append_only(self, value: impl Into<Option<bool>>) -> Self
Sets the set_append_only field of this struct.
sourcepub fn set_treepack_size(self, value: impl Into<Option<ByteSize>>) -> Self
pub fn set_treepack_size(self, value: impl Into<Option<ByteSize>>) -> Self
Sets the set_treepack_size field of this struct.
sourcepub fn set_treepack_size_limit(self, value: impl Into<Option<ByteSize>>) -> Self
pub fn set_treepack_size_limit(self, value: impl Into<Option<ByteSize>>) -> Self
Sets the set_treepack_size_limit field of this struct.
sourcepub fn set_treepack_growfactor(self, value: impl Into<Option<u32>>) -> Self
pub fn set_treepack_growfactor(self, value: impl Into<Option<u32>>) -> Self
Sets the set_treepack_growfactor field of this struct.
sourcepub fn set_datapack_size(self, value: impl Into<Option<ByteSize>>) -> Self
pub fn set_datapack_size(self, value: impl Into<Option<ByteSize>>) -> Self
Sets the set_datapack_size field of this struct.
sourcepub fn set_datapack_growfactor(self, value: impl Into<Option<u32>>) -> Self
pub fn set_datapack_growfactor(self, value: impl Into<Option<u32>>) -> Self
Sets the set_datapack_growfactor field of this struct.
sourcepub fn set_datapack_size_limit(self, value: impl Into<Option<ByteSize>>) -> Self
pub fn set_datapack_size_limit(self, value: impl Into<Option<ByteSize>>) -> Self
Sets the set_datapack_size_limit field of this struct.
sourcepub fn set_min_packsize_tolerate_percent(
self,
value: impl Into<Option<u32>>,
) -> Self
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.
sourcepub fn set_max_packsize_tolerate_percent(
self,
value: impl Into<Option<u32>>,
) -> Self
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.
sourcepub fn set_extra_verify(self, value: impl Into<Option<bool>>) -> Self
pub fn set_extra_verify(self, value: impl Into<Option<bool>>) -> Self
Sets the set_extra_verify field of this struct.
source§impl ConfigOptions
impl ConfigOptions
sourcepub fn apply(&self, config: &mut ConfigFile) -> RusticResult<()>
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
CommandErrorKind::VersionNotSupported- If the version is not supportedCommandErrorKind::CannotDowngrade- If the version is lower than the current versionCommandErrorKind::NoCompressionV1Repo- If compression is set for a v1 repoCommandErrorKind::CompressionLevelNotSupported- If the compression level is not supportedCommandErrorKind::SizeTooLarge- If the size is too largeCommandErrorKind::MinPackSizeTolerateWrong- If the min packsize tolerate percent is wrongCommandErrorKind::MaxPackSizeTolerateWrong- If the max packsize tolerate percent is wrong
Trait Implementations§
source§impl Args for ConfigOptions
impl Args for ConfigOptions
source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
source§impl Clone for ConfigOptions
impl Clone for ConfigOptions
source§fn clone(&self) -> ConfigOptions
fn clone(&self) -> ConfigOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl CommandFactory for ConfigOptions
impl CommandFactory for ConfigOptions
source§impl Debug for ConfigOptions
impl Debug for ConfigOptions
source§impl Default for ConfigOptions
impl Default for ConfigOptions
source§fn default() -> ConfigOptions
fn default() -> ConfigOptions
source§impl FromArgMatches for ConfigOptions
impl FromArgMatches for ConfigOptions
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>
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>
ArgMatches to self.source§impl Parser for ConfigOptions
impl Parser for ConfigOptions
source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
impl Copy for ConfigOptions
Auto Trait Implementations§
impl Freeze for ConfigOptions
impl RefUnwindSafe for ConfigOptions
impl Send for ConfigOptions
impl Sync for ConfigOptions
impl Unpin for ConfigOptions
impl UnwindSafe for ConfigOptions
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
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)
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>
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>
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