PackageInfoV1

Struct PackageInfoV1 

Source
pub struct PackageInfoV1 {
Show 19 fields pub pkgname: Name, pub pkgbase: Name, pub pkgver: FullVersion, pub pkgdesc: PackageDescription, pub url: Url, pub builddate: BuildDate, pub packager: Packager, pub size: InstalledSize, pub arch: Architecture, pub license: Vec<License>, pub replaces: Vec<PackageRelation>, pub group: Vec<Group>, pub conflict: Vec<PackageRelation>, pub provides: Vec<RelationOrSoname>, pub backup: Vec<Backup>, pub depend: Vec<RelationOrSoname>, pub optdepend: Vec<OptionalDependency>, pub makedepend: Vec<PackageRelation>, pub 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

The name of the package.

§pkgbase: Name

The base name of the package.

§pkgver: FullVersion

The version of the package.

§pkgdesc: PackageDescription

The description of the package.

§url: Url

The URL of the package.

§builddate: BuildDate

The build date of the package.

§packager: Packager

The packager of the package.

§size: InstalledSize

The size of the package.

§arch: Architecture

The architecture of the package.

§license: Vec<License>

The licenses of the package.

§replaces: Vec<PackageRelation>

The packages this package replaces.

§group: Vec<Group>

The groups this package belongs to.

§conflict: Vec<PackageRelation>

The packages this package conflicts with.

§provides: Vec<RelationOrSoname>

The packages this package provides.

§backup: Vec<Backup>

The backup files of the package.

§depend: Vec<RelationOrSoname>

The dependencies of the package.

§optdepend: Vec<OptionalDependency>

The optional dependencies of the package.

§makedepend: Vec<PackageRelation>

The packages required to build this package.

§checkdepend: Vec<PackageRelation>

The packages this package is checked with.

Trait Implementations§

Source§

impl Clone for PackageInfoV1

Source§

fn clone(&self) -> PackageInfoV1

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 Debug for PackageInfoV1

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PackageInfoV1

Source§

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

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromStr for PackageInfoV1

Source§

fn from_str(input: &str) -> Result<PackageInfoV1, Self::Err>

Create a PackageInfoV1 from a &str

§Errors

Returns an Error if any of the fields in input can not be validated according to PackageInfoV1 or their respective own specification.

Source§

type Err = Error

The associated error which can be returned from parsing.
Source§

impl PartialEq for PackageInfoV1

Source§

fn eq(&self, other: &PackageInfoV1) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for PackageInfoV1

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
Source§

impl StructuralPartialEq for PackageInfoV1

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
§

impl<T> AnyEq for T
where T: Any + PartialEq,

§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

§

fn as_any(&self) -> &(dyn Any + 'static)

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.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,