Package

Struct Package 

Source
pub struct Package { /* private fields */ }
Expand description

These fields contain information about an installed software package. It contains general information about a package, such as name, version or size. It also contains installation details, such as time or location.

Implementations§

Source§

impl Package

Source

pub fn get_name(&self) -> Option<&String>

Package name

Source

pub fn set_name(&mut self, name_arg: String)

Package name

§Example

go

Source

pub fn get_version(&self) -> Option<&String>

Package version

Source

pub fn set_version(&mut self, version_arg: String)

Package version

§Example

1.12.9

Source

pub fn get_build_version(&self) -> Option<&String>

Additional information about the build version of the installed package.

For example use the commit SHA of a non-released package.

Source

pub fn set_build_version(&mut self, build_version_arg: String)

Additional information about the build version of the installed package.

For example use the commit SHA of a non-released package.

§Example

36f4f7e89dd61b0988b12ee000b98966867710cd

Source

pub fn get_description(&self) -> Option<&String>

Description of the package.

Source

pub fn set_description(&mut self, description_arg: String)

Description of the package.

§Example

Open source programming language to build simple/reliable/efficient software.

Source

pub fn get_size(&self) -> Option<&u64>

Package size in bytes.

Source

pub fn set_size(&mut self, size_arg: u64)

Package size in bytes.

§Example

62231

Source

pub fn get_installed(&self) -> Option<&Timestamp>

Time when package was installed.

Source

pub fn set_installed(&mut self, installed_arg: Timestamp)

Time when package was installed.

Source

pub fn get_path(&self) -> Option<&String>

Path where the package is installed.

Source

pub fn set_path(&mut self, path_arg: String)

Path where the package is installed.

§Example

/usr/local/Cellar/go/1.12.9/

Source

pub fn get_architecture(&self) -> Option<&String>

Package architecture.

Source

pub fn set_architecture(&mut self, architecture_arg: String)

Package architecture.

§Example

x86_64

Source

pub fn get_checksum(&self) -> Option<&String>

Checksum of the installed package for verification.

Source

pub fn set_checksum(&mut self, checksum_arg: String)

Checksum of the installed package for verification.

§Example

68b329da9893e34099c7d8ad5cb9c940

Source

pub fn get_install_scope(&self) -> Option<&String>

Indicating how the package was installed, e.g. user-local, global.

Source

pub fn set_install_scope(&mut self, install_scope_arg: String)

Indicating how the package was installed, e.g. user-local, global.

§Example

global

Source

pub fn get_license(&self) -> Option<&String>

License under which the package was released.

Use a short name, e.g. the license identifier from SPDX License List where possible (https://spdx.org/licenses/).

Source

pub fn set_license(&mut self, license_arg: String)

License under which the package was released.

Use a short name, e.g. the license identifier from SPDX License List where possible (https://spdx.org/licenses/).

§Example

Apache License 2.0

Source

pub fn get_reference(&self) -> Option<&String>

Home page or reference URL of the software in this package, if available.

Source

pub fn set_reference(&mut self, reference_arg: String)

Home page or reference URL of the software in this package, if available.

§Example

https://golang.org

Source

pub fn get_type(&self) -> Option<&String>

Type of package.

This should contain the package file type, rather than the package manager name. Examples: rpm, dpkg, brew, npm, gem, nupkg, jar.

Source

pub fn set_type(&mut self, type_arg: String)

Type of package.

This should contain the package file type, rather than the package manager name. Examples: rpm, dpkg, brew, npm, gem, nupkg, jar.

§Example

rpm

Trait Implementations§

Source§

impl Clone for Package

Source§

fn clone(&self) -> Package

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for Package

Source§

fn default() -> Package

Returns the “default value” for a type. Read more
Source§

impl Serialize for Package

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.