alpm_srcinfo::source_info::package

Struct Package

Source
pub struct Package {
Show 16 fields pub name: Name, pub description: Option<Option<PackageDescription>>, pub url: Option<Option<Url>>, pub changelog: Option<Option<RelativePath>>, pub licenses: Option<Vec<License>>, pub install: Option<Option<RelativePath>>, pub groups: Option<Vec<String>>, pub options: Option<Vec<MakepkgOption>>, pub backups: Option<Vec<RelativePath>>, pub architectures: Option<HashSet<Architecture>>, pub architecture_properties: HashMap<Architecture, PackageArchitecture>, pub dependencies: Option<Vec<RelationOrSoname>>, pub optional_dependencies: Option<Vec<OptionalDependency>>, pub provides: Option<Vec<RelationOrSoname>>, pub conflicts: Option<Vec<PackageRelation>>, pub replaces: Option<Vec<PackageRelation>>,
}
Expand description

Package metadata based on a pkgname section in SRCINFO data.

This struct only contains package specific overrides. Only in combination with PackageBase data a full view on a package’s metadata is possible.

All values and nested structs inside this struct, except the name field, are either nested Options (e.g. Option<Option<String>>) or optional collections (e.g. Option<Vec>). This is due to the fact that all fields are overrides for the defaults set by the PackageBase struct.

  • If a value is None, this indicates that the PackageBase’s value should be used.
  • If a value is Some<None>, this means that the value should be empty and the PackageBase should be ignored. The same goes for collections in the sense of Some(Vec::new()).
  • If a value is Some(Some(value)) or Some(vec![values]), these values should then be used.

This struct merely contains the overrides that should be applied on top of the PackageBase to get the final definition of this package. Take a look at SourceInfo::packages_for_architecture on how to get the merged representation MergedPackage of a package.

Fields§

§name: Name§description: Option<Option<PackageDescription>>§url: Option<Option<Url>>§changelog: Option<Option<RelativePath>>§licenses: Option<Vec<License>>§install: Option<Option<RelativePath>>§groups: Option<Vec<String>>§options: Option<Vec<MakepkgOption>>§backups: Option<Vec<RelativePath>>§architectures: Option<HashSet<Architecture>>

These are all override fields that may be architecture specific.

§architecture_properties: HashMap<Architecture, PackageArchitecture>§dependencies: Option<Vec<RelationOrSoname>>§optional_dependencies: Option<Vec<OptionalDependency>>§provides: Option<Vec<RelationOrSoname>>§conflicts: Option<Vec<PackageRelation>>§replaces: Option<Vec<PackageRelation>>

Implementations§

Source§

impl Package

Source

pub fn from_parsed( line_start: usize, package_base_architectures: &HashSet<Architecture>, parsed: RawPackage, errors: &mut Vec<SourceInfoError>, ) -> Self

Creates a new Package instance from a RawPackage.

§Parameters
  • line_start: The number of preceding lines, so that error/lint messages can reference the correct lines.
  • parsed: The RawPackage representation of the SRCINFO data. The input guarantees that the keyword assignments have been parsed correctly, but not yet that they represent valid SRCINFO data as a whole.
  • errors: All errors and lints encountered during the creation of the Package.
§Errors

This function does not return a Result, but instead relies on aggregating all lints, warnings and errors in errors. This allows to keep the function call recoverable, so that all errors and lints can be returned all at once.

Trait Implementations§

Source§

impl Clone for Package

Source§

fn clone(&self) -> Package

Returns a copy 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 Package

Source§

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

Formats the value using the given formatter. 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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> 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, 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.
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T