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

A struct representing a version of an apt Package

Implementations

Return the version’s parent package.

The architecture of the version.

The version string of the version. “1.4.10”

The section of the version as shown in apt show.

The priority string as shown in apt show.

The name of the source package the version was built from.

The version of the source package.

The priority of the package as shown in apt policy.

The size of the .deb file.

The uncompressed size of the .deb file.

The ID of the version.

If the version is able to be downloaded.

Check if the version is installed

Returns a reference to the Dependency Map owned by the Version

let keys = [
   "Depends",
   "PreDepends",
   "Suggests",
   "Recommends",
   "Conflicts",
   "Replaces",
   "Obsoletes",
   "Breaks",
   "Enhances",
];

Dependencies are in a Vec<Dependency>

The Dependency struct represents an Or Group of dependencies. The base deps are located in Dependency.base_deps

For example where we use the "Depends" key:

use rust_apt::cache::Cache;
let cache = Cache::new();
let version = cache.get("apt").unwrap().candidate().unwrap();
for dep in version.depends_map().get("Depends").unwrap() {
   if dep.is_or() {
       for base_dep in &dep.base_deps {
           println!("{}", base_dep.name())
       }
   } else {
       // is_or is false so there is only one BaseDep
       println!("{}", dep.first().name())
   }
}

Returns a reference Vector, if it exists, for the given key.

See the doc for depends_map() for more information.

Returns a Reference Vector, if it exists, for “Enhances”.

Returns a Reference Vector, if it exists, for “Depends” and “PreDepends”.

Returns a Reference Vector, if it exists, for “Recommends”.

Returns a Reference Vector, if it exists, for “suggests”.

Get the translated long description

Get the translated short description

Get the sha256 hash. If there isn’t one returns None This is equivalent to version.hash("sha256")

Get the sha512 hash. If there isn’t one returns None This is equivalent to version.hash("sha512")

Get the hash specified. If there isn’t one returns None version.hash("md5sum")

Returns an iterator of PackageFiles (Origins) for the version

Returns an iterator of URIs for the version

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

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. 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.