Struct rust_apt::depcache::DepCache

source ·
pub struct DepCache { /* private fields */ }

Implementations§

source§

impl DepCache

source

pub fn new(ptr: DepCache) -> DepCache

source

pub fn clear_marked(&self) -> Result<(), Exception>

Clear any marked changes in the DepCache.

source

pub fn disk_size(&self) -> DiskSpace

The amount of space required for installing/removing the packages,“

i.e. the Installed-Size of all packages marked for installation“ minus the Installed-Size of all packages for removal.“

Methods from Deref<Target = DepCache>§

source

pub fn init(&self, callback: &mut DynOperationProgress) -> Result<(), Exception>

source

pub fn fix_broken(&self) -> bool

Autoinstall every broken package and run the problem resolver Returns false if the problem resolver fails.

source

pub fn action_group(&self) -> ActionGroup

Return a new ActionGroup of the current DepCache

ActionGroup will be released once it leaves scope or [‘ActionGroup::release’] is called

source

pub fn full_upgrade( &self, progress: &mut DynOperationProgress ) -> Result<(), Exception>

Perform a Full Upgrade. Remove and install new packages if necessary.

source

pub fn safe_upgrade( &self, progress: &mut DynOperationProgress ) -> Result<(), Exception>

Perform a Safe Upgrade. Neither remove or install new packages.

source

pub fn install_upgrade( &self, progress: &mut DynOperationProgress ) -> Result<(), Exception>

Perform an Install Upgrade. New packages will be installed but nothing will be removed.

source

pub fn is_upgradable(&self, pkg: &Package) -> bool

Check if the package is upgradable.

§skip_depcache:

Skipping the DepCache is unnecessary if it’s already been initialized. If you’re unsure use false

  • true = Increases performance by skipping the pkgDepCache.
  • false = Use DepCache to check if the package is upgradable
source

pub fn is_auto_installed(&self, pkg: &Package) -> bool

Is the Package auto installed? Packages marked as auto installed are usually dependencies.

source

pub fn is_garbage(&self, pkg: &Package) -> bool

Is the Package able to be auto removed?

source

pub fn marked_install(&self, pkg: &Package) -> bool

Is the Package marked for install?

source

pub fn marked_upgrade(&self, pkg: &Package) -> bool

Is the Package marked for upgrade?

source

pub fn marked_purge(&self, pkg: &Package) -> bool

Is the Package marked to be purged?

source

pub fn marked_delete(&self, pkg: &Package) -> bool

Is the Package marked for removal?

source

pub fn marked_keep(&self, pkg: &Package) -> bool

Is the Package marked for keep?

source

pub fn marked_downgrade(&self, pkg: &Package) -> bool

Is the Package marked for downgrade?

source

pub fn marked_reinstall(&self, pkg: &Package) -> bool

Is the Package marked for reinstall?

source

pub fn mark_auto(&self, pkg: &Package, mark_auto: bool)

§Mark a package as automatically installed.
§mark_auto:
  • true = Mark the package as automatically installed.
  • false = Mark the package as manually installed.
source

pub fn mark_keep(&self, pkg: &Package) -> bool

§Mark a package for keep.
§Returns:
  • true if the mark was successful
  • false if the mark was unsuccessful

This means that the package will not be changed from its current version. This will not stop a reinstall, but will stop removal, upgrades and downgrades

We don’t believe that there is any reason to unmark packages for keep. If someone has a reason, and would like it implemented, please put in a feature request.

source

pub fn mark_delete(&self, pkg: &Package, purge: bool) -> bool

§Mark a package for removal.
§Returns:
  • true if the mark was successful
  • false if the mark was unsuccessful
§purge:
  • true = Configuration files will be removed along with the package.
  • false = Only the package will be removed.
source

pub fn mark_install( &self, pkg: &Package, auto_inst: bool, from_user: bool ) -> bool

§Mark a package for installation.
§auto_inst:
  • true = Additionally mark the dependencies for this package.
  • false = Mark only this package.
§from_user:
  • true = The package will be marked manually installed.
  • false = The package will be unmarked automatically installed.
§Returns:
  • true if the mark was successful
  • false if the mark was unsuccessful

If a package is already installed, at the latest version, and you mark that package for install you will get true, but the package will not be altered. pkg.marked_install() will be false

source

pub fn set_candidate_version(&self, ver: &Version)

Set a version to be the candidate of it’s package.

source

pub fn unsafe_candidate_version(&self, pkg: &Package) -> Version

Get a pointer to the version that is set to be installed.

Safety: If there is no candidate the inner pointer will be null. This will cause segfaults if methods are used on a Null Version.

source

pub fn mark_reinstall(&self, pkg: &Package, reinstall: bool)

§Mark a package for reinstallation.
§Returns:
  • true if the mark was successful
  • false if the mark was unsuccessful
§reinstall:
  • true = The package will be marked for reinstall.
  • false = The package will be unmarked for reinstall.
source

pub fn is_now_broken(&self, pkg: &Package) -> bool

Is the installed Package broken?

source

pub fn is_inst_broken(&self, pkg: &Package) -> bool

Is the Package to be installed broken?

source

pub fn install_count(&self) -> u32

The number of packages marked for installation.

source

pub fn delete_count(&self) -> u32

The number of packages marked for removal.

source

pub fn keep_count(&self) -> u32

The number of packages marked for keep.

source

pub fn broken_count(&self) -> u32

The number of packages with broken dependencies in the cache.

source

pub fn download_size(&self) -> u64

The size of all packages to be downloaded.

source

pub fn disk_size(&self) -> i64

The amount of space required for installing/removing the packages,“

i.e. the Installed-Size of all packages marked for installation“ minus the Installed-Size of all packages for removal.“

source

pub fn candidate_version(&self, pkg: &RawPackage) -> Option<RawVersion>

Trait Implementations§

source§

impl Deref for DepCache

§

type Target = DepCache

The resulting type after dereferencing.
source§

fn deref(&self) -> &DepCache

Dereferences the value.

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