pub struct Package<'a> { /* private fields */ }
Expand description

A struct representing an apt Package

Implementations

Get the fullname of the package.

Pretty is a bool that will omit the native arch.

For example on an amd64 system:

use rust_apt::cache::Cache;
let cache = Cache::new();
if let Some(pkg) = cache.get("apt") {
   // Prints just "apt"
   println!("{}", pkg.fullname(true));
   // Prints "apt:amd64"
   println!("{}", pkg.fullname(false));
};

if let Some(pkg) = cache.get("apt:i386") {
   // Prints "apt:i386" for the i386 package
   println!("{}", pkg.fullname(true));
};

Return the name of the package without the architecture

Get the architecture of the package.

Get the ID of the package.

The current state of the package.

The installed state of the package.

The selected state of the package.

Check if the package is essnetial or not.

Check if the package has versions.

Check if the package has provides.

Returns the version object of the candidate.

If there isn’t a candidate, returns None

Returns the version object of the installed version.

If there isn’t an installed version, returns None

Check if the package is installed.

Check if the package is upgradable.

skip_depcache = true increases performance by skipping the pkgDepCache Skipping the depcache is very unnecessary if it’s already been initialized If you’re not sure, set skip_depcache = false

Check if the package is auto installed. (Not installed by the user)

Check if the package is auto removable

Check if the package is now broken

Check if the package package installed is broken

Check if the package is marked install

Check if the package is marked upgrade

Check if the package is marked delete

Check if the package is marked keep

Check if the package is marked downgrade

Check if the package is marked reinstall

Returns a version list starting with the newest and ending with the oldest.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.