pub struct PkgDepCache { /* private fields */ }Implementations§
Source§impl PkgDepCache
impl PkgDepCache
Sourcepub fn init(
&self,
callback: Pin<&mut OperationProgress<'_>>,
) -> Result<(), Exception>
pub fn init( &self, callback: Pin<&mut OperationProgress<'_>>, ) -> Result<(), Exception>
Clear any marked changes in the DepCache.
Sourcepub fn fix_broken(&self) -> bool
pub fn fix_broken(&self) -> bool
Autoinstall every broken package and run the problem resolver Returns false if the problem resolver fails.
Sourcepub unsafe fn action_group(&self) -> UniquePtr<ActionGroup>
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.
Sourcepub fn upgrade(
&self,
progress: Pin<&mut OperationProgress<'_>>,
upgrade_mode: i32,
) -> Result<(), Exception>
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.
Sourcepub fn is_upgradable(&self, pkg: &PkgIterator) -> bool
pub fn is_upgradable(&self, pkg: &PkgIterator) -> bool
Check if the package is upgradable.
Sourcepub fn is_auto_installed(&self, pkg: &PkgIterator) -> bool
pub fn is_auto_installed(&self, pkg: &PkgIterator) -> bool
Is the Package auto installed? Packages marked as auto installed are usually dependencies.
Sourcepub fn is_garbage(&self, pkg: &PkgIterator) -> bool
pub fn is_garbage(&self, pkg: &PkgIterator) -> bool
Is the Package able to be auto removed?
Sourcepub fn marked_new_install(&self, pkg: &PkgIterator) -> bool
pub fn marked_new_install(&self, pkg: &PkgIterator) -> bool
Is the Package marked NewInstall.
Sourcepub fn marked_install(&self, pkg: &PkgIterator) -> bool
pub fn marked_install(&self, pkg: &PkgIterator) -> bool
Is the Package marked for install?
Sourcepub fn marked_upgrade(&self, pkg: &PkgIterator) -> bool
pub fn marked_upgrade(&self, pkg: &PkgIterator) -> bool
Is the Package marked for upgrade?
Sourcepub fn marked_purge(&self, pkg: &PkgIterator) -> bool
pub fn marked_purge(&self, pkg: &PkgIterator) -> bool
Is the Package marked to be purged?
Sourcepub fn marked_delete(&self, pkg: &PkgIterator) -> bool
pub fn marked_delete(&self, pkg: &PkgIterator) -> bool
Is the Package marked for removal?
Sourcepub fn marked_held(&self, pkg: &PkgIterator) -> bool
pub fn marked_held(&self, pkg: &PkgIterator) -> bool
Is the Package held?
Sourcepub fn marked_keep(&self, pkg: &PkgIterator) -> bool
pub fn marked_keep(&self, pkg: &PkgIterator) -> bool
Is the Package marked for keep?
Sourcepub fn marked_downgrade(&self, pkg: &PkgIterator) -> bool
pub fn marked_downgrade(&self, pkg: &PkgIterator) -> bool
Is the Package marked for downgrade?
Sourcepub fn marked_reinstall(&self, pkg: &PkgIterator) -> bool
pub fn marked_reinstall(&self, pkg: &PkgIterator) -> bool
Is the Package marked for reinstall?
Sourcepub fn mark_auto(&self, pkg: &PkgIterator, mark_auto: bool)
pub fn mark_auto(&self, pkg: &PkgIterator, mark_auto: bool)
Sourcepub fn mark_keep(&self, pkg: &PkgIterator) -> bool
pub fn mark_keep(&self, pkg: &PkgIterator) -> bool
§Mark a package for keep.
§Returns:
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.
Sourcepub fn mark_delete(&self, pkg: &PkgIterator, purge: bool) -> bool
pub fn mark_delete(&self, pkg: &PkgIterator, purge: bool) -> bool
Sourcepub fn mark_install(
&self,
pkg: &PkgIterator,
auto_inst: bool,
from_user: bool,
) -> bool
pub fn mark_install( &self, pkg: &PkgIterator, auto_inst: bool, from_user: bool, ) -> bool
§Mark a package for installation.
§auto_inst:
§from_user:
- true = The package will be marked manually installed.
- false = The package will be unmarked automatically installed.
§Returns:
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
Sourcepub fn set_candidate_version(&self, ver: &VerIterator)
pub fn set_candidate_version(&self, ver: &VerIterator)
Set a version to be the candidate of it’s package.
Sourcepub unsafe fn candidate_version(
&self,
pkg: &PkgIterator,
) -> UniquePtr<VerIterator>
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.
Sourcepub unsafe fn install_version(
&self,
pkg: &PkgIterator,
) -> UniquePtr<VerIterator>
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.
Sourcepub fn dep_state(&self, dep: &DepIterator) -> u8
pub fn dep_state(&self, dep: &DepIterator) -> u8
Returns the state of the dependency as u8
Sourcepub fn is_important_dep(&self, dep: &DepIterator) -> bool
pub fn is_important_dep(&self, dep: &DepIterator) -> bool
Sourcepub fn mark_reinstall(&self, pkg: &PkgIterator, reinstall: bool)
pub fn mark_reinstall(&self, pkg: &PkgIterator, reinstall: bool)
Sourcepub fn is_now_broken(&self, pkg: &PkgIterator) -> bool
pub fn is_now_broken(&self, pkg: &PkgIterator) -> bool
Is the installed Package broken?
Sourcepub fn is_inst_broken(&self, pkg: &PkgIterator) -> bool
pub fn is_inst_broken(&self, pkg: &PkgIterator) -> bool
Is the Package to be installed broken?
Sourcepub fn install_count(&self) -> u32
pub fn install_count(&self) -> u32
The number of packages marked for installation.
Sourcepub fn delete_count(&self) -> u32
pub fn delete_count(&self) -> u32
The number of packages marked for removal.
Sourcepub fn keep_count(&self) -> u32
pub fn keep_count(&self) -> u32
The number of packages marked for keep.
Sourcepub fn broken_count(&self) -> u32
pub fn broken_count(&self) -> u32
The number of packages with broken dependencies in the cache.
Sourcepub fn download_size(&self) -> u64
pub fn download_size(&self) -> u64
The size of all packages to be downloaded.