Enum SyncOption

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

Source§

fn clone(&self) -> SyncOption

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 Debug for SyncOption

Source§

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

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

impl Hash for SyncOption

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for SyncOption

Source§

fn eq(&self, other: &SyncOption) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for SyncOption

Source§

impl Eq for SyncOption

Source§

impl StructuralPartialEq for SyncOption

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
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> 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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,