#[non_exhaustive]pub enum SyncOption {
Show 15 variants
AssumeYes,
DownloadOnly,
EscapeHold,
IgnoreCache,
IgnoreFailure,
NoDependencies,
NoHashCheck,
NoUpgrade,
NoReplace,
Offline,
OnlyUpgrade,
Remove,
Purge,
Cascade,
NoDependentCheck,
}
Expand description
Options that may be used to tweak behavior of package sync operation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AssumeYes
Assume YES on all prompts.
§Note
This option will also suppress the prompt for package candidate selection. A built-in candidate selection algorithm will be used to select the proper candidate. This may not be the desired behavior in some cases.
Enabling this option will also suppress the calculation of download size.
DownloadOnly
Download package only.
§Note
To sync packages by just downloading and caching them without installing or upgrading, this option can be used. Transcation will be stopped after the download is done.
EscapeHold
Force operations on held packages.
§Note
Held packages are ignored during the replace, upgrade or uninstall operations by default. The option can be used to escape the hold and enforce operations on the held packages.
Packages will be held again after the replace or upgrade operation.
IgnoreCache
Ignore local cache and force package download.
§Note
This option is not intended to be used with the Offline
option.
IgnoreFailure
Ignore transaction failure.
The sync operation processes packages in the transaction one by one according to the dependency order. By default, the transaction will be aborted if any failure occurs during the operation.
§Note
This option can be used to ignore the failure and continue the operation to commit the remaining packages in the transaction.
When a failure occurs, the operation will be stopped immediately and a rollback will be performed on the exact package causing the failure while successfully committed packages will be kept be as they are. The rest of the unpocessed packages will be skipped, and the error will be returned.
NO rollback will be performed if this option is enabled, which means there may be broken packages being committed to the system.
NoDependencies
Do not install dependencies.
§Note
By default, dependencies of the pending installation package will be resolved and installed recursively if they are not installed yet. One can opt in this option to disable the default behavior. However, it is not recommended to do so since it clearly breaks the dependency relationship, and may stop the dependents from working properly.
NoHashCheck
Stop checking hash of downloaded packages.
§Note
Integrity check helps to ensure the downloaded packages are not corrupted or tampered. Hash check will be performed by default. In some cases, user may want to skip the check to force the installation or upgrade of the packages. By opting in this option, the hash check will be skipped.
It is highly NOT recommended to use this option unless you really know what you are doing.
NoUpgrade
Do not upgrade packages.
This option is not intended to be used with the OnlyUpgrade
option.
NoReplace
Do not replace packages.
§Note
When a package is installed and a same-named package is proposed to be installed, a replace operation will be performed if the proposed package is from a different bucket from the installed one.
By opting in this option, the replace operation will be suppressed.
Offline
Offline mode.
§Note
This option is useful when user wants to install or upgrade packages with existing local cached packages. By opting in this option and having valid caches prepared, network access can be avoided to perform the sync operation. However, the transaction may fail if there is any package file missing or invalid cache.
This option is basically the opposite of the IgnoreCache
option.
OnlyUpgrade
Upgrade packages only.
Use this option to specify a sync operation of only upgrading packages.
This option is not intended to be used with the NoUpgrade
option.
Remove
Uninstall packages.
Use this option to specify a sync operation of only uninstalling packages.
Purge
Purge uninstall.
§Note
By enabling this option, persistent data of the pending removal packages will be removed simultaneously.
This option only takes effect with the Remove
option.
Cascade
Cascade uninstall.
§Note
By opt in this option, dependencies of the pending removal package will also be removed recursively if they are not required by other installed packages.
This option only takes effect with the Remove
option.
NoDependentCheck
Disable dependent check.
§Note
By default, a reverse dependencies check will be performed on the pending removal package. If any installed package depends on the pending removal package, the removal operation will be aborted.
The default behavior can be modified by opting in this option, however, it is not recommended to do so since it clearly breaks the dependency relationship, and may stop the dependents from working properly.
This option only takes effect with the Remove
option.
Trait Implementations§
Source§impl Clone for SyncOption
impl Clone for SyncOption
Source§fn clone(&self) -> SyncOption
fn clone(&self) -> SyncOption
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SyncOption
impl Debug for SyncOption
Source§impl Hash for SyncOption
impl Hash for SyncOption
Source§impl PartialEq for SyncOption
impl PartialEq for SyncOption
impl Copy for SyncOption
impl Eq for SyncOption
impl StructuralPartialEq for SyncOption
Auto Trait Implementations§
impl Freeze for SyncOption
impl RefUnwindSafe for SyncOption
impl Send for SyncOption
impl Sync for SyncOption
impl Unpin for SyncOption
impl UnwindSafe for SyncOption
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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