pub struct PackageInfoV1 {Show 19 fields
pkgname: Name,
pkgbase: Name,
pkgver: Version,
pkgdesc: PackageDescription,
url: Url,
builddate: BuildDate,
packager: Packager,
size: InstalledSize,
arch: Architecture,
license: Vec<License>,
replaces: Vec<PackageRelation>,
group: Vec<Group>,
conflict: Vec<PackageRelation>,
provides: Vec<RelationOrSoname>,
backup: Vec<Backup>,
depend: Vec<RelationOrSoname>,
optdepend: Vec<OptionalDependency>,
makedepend: Vec<PackageRelation>,
checkdepend: Vec<PackageRelation>,
}
Expand description
PKGINFO version 1
PackageInfoV1
is (exclusively) compatible with data following the first specification of the
PKGINFO file.
§Examples
use std::str::FromStr;
use alpm_pkginfo::PackageInfoV1;
let pkginfo_data = r#"pkgname = example
pkgbase = example
pkgver = 1:1.0.0-1
pkgdesc = A project that does something
url = https://example.org/
builddate = 1729181726
packager = John Doe <john@example.org>
size = 181849963
arch = any
license = GPL-3.0-or-later
license = LGPL-3.0-or-later
replaces = other-package>0.9.0-3
group = package-group
group = other-package-group
conflict = conflicting-package<1.0.0
conflict = other-conflicting-package<1.0.0
provides = some-component
provides = some-other-component=1:1.0.0-1
provides = libexample.so=1-64
provides = libunversionedexample.so=libunversionedexample.so-64
provides = lib:libexample.so.1
backup = etc/example/config.toml
backup = etc/example/other-config.txt
depend = glibc
depend = gcc-libs
depend = libother.so=0-64
depend = libunversioned.so=libunversioned.so-64
depend = lib:libother.so.0
optdepend = python: for special-python-script.py
optdepend = ruby: for special-ruby-script.rb
makedepend = cmake
makedepend = python-sphinx
checkdepend = extra-test-tool
checkdepend = other-extra-test-tool"#;
let pkginfo = PackageInfoV1::from_str(pkginfo_data)?;
assert_eq!(pkginfo.to_string(), pkginfo_data);
Fields§
§pkgname: Name
§pkgbase: Name
§pkgver: Version
§pkgdesc: PackageDescription
§url: Url
§builddate: BuildDate
§packager: Packager
§size: InstalledSize
§arch: Architecture
§license: Vec<License>
§replaces: Vec<PackageRelation>
§group: Vec<Group>
§conflict: Vec<PackageRelation>
§provides: Vec<RelationOrSoname>
§backup: Vec<Backup>
§depend: Vec<RelationOrSoname>
§optdepend: Vec<OptionalDependency>
§makedepend: Vec<PackageRelation>
§checkdepend: Vec<PackageRelation>
Implementations§
Source§impl PackageInfoV1
impl PackageInfoV1
Sourcepub fn pkgdesc(&self) -> &PackageDescription
pub fn pkgdesc(&self) -> &PackageDescription
Returns the description of the package
Sourcepub fn size(&self) -> &InstalledSize
pub fn size(&self) -> &InstalledSize
Returns the size of the package
Sourcepub fn arch(&self) -> &Architecture
pub fn arch(&self) -> &Architecture
Returns the architecture of the package
Sourcepub fn replaces(&self) -> &[PackageRelation]
pub fn replaces(&self) -> &[PackageRelation]
Returns the packages this package replaces
Sourcepub fn conflict(&self) -> &[PackageRelation]
pub fn conflict(&self) -> &[PackageRelation]
Returns the packages this package conflicts with
Sourcepub fn provides(&self) -> &[RelationOrSoname]
pub fn provides(&self) -> &[RelationOrSoname]
Returns the packages this package provides
Sourcepub fn depend(&self) -> &[RelationOrSoname]
pub fn depend(&self) -> &[RelationOrSoname]
Returns the packages this package depends on
Sourcepub fn optdepend(&self) -> &[OptionalDependency]
pub fn optdepend(&self) -> &[OptionalDependency]
Returns the optional dependencies of the package
Sourcepub fn makedepend(&self) -> &[PackageRelation]
pub fn makedepend(&self) -> &[PackageRelation]
Returns the packages this package is built with
Sourcepub fn checkdepend(&self) -> &[PackageRelation]
pub fn checkdepend(&self) -> &[PackageRelation]
Returns the packages this package is checked with
Source§impl PackageInfoV1
impl PackageInfoV1
Sourcepub fn new(
name: Name,
base: Name,
version: Version,
desc: PackageDescription,
url: Url,
builddate: BuildDate,
packager: Packager,
size: InstalledSize,
arch: Architecture,
license: Vec<License>,
replaces: Vec<PackageRelation>,
group: Vec<Group>,
conflict: Vec<PackageRelation>,
provides: Vec<RelationOrSoname>,
backup: Vec<Backup>,
depend: Vec<RelationOrSoname>,
optdepend: Vec<OptionalDependency>,
makedepend: Vec<PackageRelation>,
checkdepend: Vec<PackageRelation>,
) -> Self
pub fn new( name: Name, base: Name, version: Version, desc: PackageDescription, url: Url, builddate: BuildDate, packager: Packager, size: InstalledSize, arch: Architecture, license: Vec<License>, replaces: Vec<PackageRelation>, group: Vec<Group>, conflict: Vec<PackageRelation>, provides: Vec<RelationOrSoname>, backup: Vec<Backup>, depend: Vec<RelationOrSoname>, optdepend: Vec<OptionalDependency>, makedepend: Vec<PackageRelation>, checkdepend: Vec<PackageRelation>, ) -> Self
Create a new PackageInfoV1 from all required components
Trait Implementations§
Source§impl Clone for PackageInfoV1
impl Clone for PackageInfoV1
Source§fn clone(&self) -> PackageInfoV1
fn clone(&self) -> PackageInfoV1
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PackageInfoV1
impl Debug for PackageInfoV1
Source§impl<'de> Deserialize<'de> for PackageInfoV1
impl<'de> Deserialize<'de> for PackageInfoV1
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for PackageInfoV1
impl Display for PackageInfoV1
Auto Trait Implementations§
impl Freeze for PackageInfoV1
impl RefUnwindSafe for PackageInfoV1
impl Send for PackageInfoV1
impl Sync for PackageInfoV1
impl Unpin for PackageInfoV1
impl UnwindSafe for PackageInfoV1
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more