Struct PkgDepCache

Source
#[repr(C)]
pub struct PkgDepCache { /* private fields */ }

Implementations§

Source§

impl PkgDepCache

Source

pub fn init( &self, callback: Pin<&mut OperationProgress<'_>>, ) -> Result<(), Exception>

Clear any marked changes in the DepCache.

Source§

impl PkgDepCache

Source

pub fn fix_broken(&self) -> bool

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

Source§

impl PkgDepCache

Source

pub unsafe fn action_group(&self) -> UniquePtr<ActionGroup>

Return a new ActionGroup of the current DepCache

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

§Safety

The returned UniquePtr cannot outlive the cache.

Source§

impl PkgDepCache

Source

pub fn upgrade( &self, progress: Pin<&mut OperationProgress<'_>>, upgrade_mode: i32, ) -> Result<(), Exception>

Perform an Upgrade.

§mark_auto:
  • [0] = Remove and install new packages if necessary.
  • [1] = New packages will be installed but nothing will be removed.
  • [3] = Neither remove or install new packages.
Source§

impl PkgDepCache

Source

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

Check if the package is upgradable.

Source§

impl PkgDepCache

Source

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

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

Source§

impl PkgDepCache

Source

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

Is the Package able to be auto removed?

Source§

impl PkgDepCache

Source

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

Is the Package marked for install?

Source§

impl PkgDepCache

Source

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

Is the Package marked for upgrade?

Source§

impl PkgDepCache

Source

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

Is the Package marked to be purged?

Source§

impl PkgDepCache

Source

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

Is the Package marked for removal?

Source§

impl PkgDepCache

Source

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

Is the Package marked for keep?

Source§

impl PkgDepCache

Source

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

Is the Package marked for downgrade?

Source§

impl PkgDepCache

Source

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

Is the Package marked for reinstall?

Source§

impl PkgDepCache

Source

pub fn mark_auto(&self, pkg: &PkgIterator, 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§

impl PkgDepCache

Source

pub fn mark_keep(&self, pkg: &PkgIterator) -> 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§

impl PkgDepCache

Source

pub fn mark_delete(&self, pkg: &PkgIterator, 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§

impl PkgDepCache

Source

pub fn mark_install( &self, pkg: &PkgIterator, 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§

impl PkgDepCache

Source

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

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

Source§

impl PkgDepCache

Source

pub unsafe fn candidate_version( &self, pkg: &PkgIterator, ) -> UniquePtr<VerIterator>

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.

Using crate::raw::IntoRawIter::make_safe to convert to an Option is recommended.

The returned UniquePtr cannot outlive the cache.

Source§

impl PkgDepCache

Source

pub unsafe fn install_version( &self, pkg: &PkgIterator, ) -> UniquePtr<VerIterator>

Get a pointer to the version that is installed.

§Safety

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

Using crate::raw::IntoRawIter::make_safe to convert to an Option is recommended.

The returned UniquePtr cannot outlive the cache.

Source§

impl PkgDepCache

Source

pub fn dep_state(&self, dep: &DepIterator) -> u8

Returns the state of the dependency as u8

Source§

impl PkgDepCache

Source

pub fn is_important_dep(&self, dep: &DepIterator) -> bool

Checks if the dependency is important.

Depends, PreDepends, Conflicts, Obsoletes, Breaks will return true.

Suggests, Recommends will return true if they are configured to be installed.

Source§

impl PkgDepCache

Source

pub fn mark_reinstall(&self, pkg: &PkgIterator, 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§

impl PkgDepCache

Source

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

Is the installed Package broken?

Source§

impl PkgDepCache

Source

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

Is the Package to be installed broken?

Source§

impl PkgDepCache

Source

pub fn install_count(&self) -> u32

The number of packages marked for installation.

Source§

impl PkgDepCache

Source

pub fn delete_count(&self) -> u32

The number of packages marked for removal.

Source§

impl PkgDepCache

Source

pub fn keep_count(&self) -> u32

The number of packages marked for keep.

Source§

impl PkgDepCache

Source

pub fn broken_count(&self) -> u32

The number of packages with broken dependencies in the cache.

Source§

impl PkgDepCache

Source

pub fn download_size(&self) -> u64

The size of all packages to be downloaded.

Source§

impl PkgDepCache

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

Trait Implementations§

Source§

impl ExternType for PkgDepCache

Source§

type Kind = Opaque

Source§

type Id

A type-level representation of the type’s C++ namespace and type name. Read more
Source§

impl UniquePtrTarget for PkgDepCache

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

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.