pub struct BuildInfoV1 {
format: Schema,
pkgname: Name,
pkgbase: Name,
pkgver: Version,
pkgarch: Architecture,
pkgbuild_sha256sum: Checksum<Sha256>,
packager: Packager,
builddate: BuildDate,
builddir: BuildDir,
buildenv: Vec<BuildEnv>,
options: Vec<PackageOption>,
installed: Vec<InstalledPackage>,
}
Expand description
BUILDINFO version 1
BuildInfoV1
is (exclusively) compatible with data following the first specification of the
BUILDINFO file.
§Examples
use std::str::FromStr;
use alpm_buildinfo::BuildInfoV1;
let buildinfo_data = r#"format = 1
pkgname = foo
pkgbase = foo
pkgver = 1:1.0.0-1
pkgarch = any
pkgbuild_sha256sum = b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c
packager = Foobar McFooface <foobar@mcfooface.org>
builddate = 1
builddir = /build
buildenv = envfoo
buildenv = envbar
options = some_option
options = !other_option
installed = bar-1.2.3-1-any
installed = beh-2.2.3-4-any
"#;
let buildinfo = BuildInfoV1::from_str(buildinfo_data)?;
assert_eq!(buildinfo.to_string(), buildinfo_data);
Fields§
§format: Schema
§pkgname: Name
§pkgbase: Name
§pkgver: Version
§pkgarch: Architecture
§pkgbuild_sha256sum: Checksum<Sha256>
§packager: Packager
§builddate: BuildDate
§builddir: BuildDir
§buildenv: Vec<BuildEnv>
§options: Vec<PackageOption>
§installed: Vec<InstalledPackage>
Implementations§
source§impl BuildInfoV1
impl BuildInfoV1
sourcepub fn format(&self) -> &SchemaVersion
pub fn format(&self) -> &SchemaVersion
Returns the format of the BUILDINFO file
sourcepub fn pkgarch(&self) -> &Architecture
pub fn pkgarch(&self) -> &Architecture
Returns the package architecture
sourcepub fn pkgbuild_sha256sum(&self) -> &Checksum<Sha256>
pub fn pkgbuild_sha256sum(&self) -> &Checksum<Sha256>
Returns the package build SHA-256 checksum
sourcepub fn options(&self) -> &Vec<PackageOption>
pub fn options(&self) -> &Vec<PackageOption>
Returns the package options
sourcepub fn installed(&self) -> &Vec<InstalledPackage>
pub fn installed(&self) -> &Vec<InstalledPackage>
Returns the installed packages
source§impl BuildInfoV1
impl BuildInfoV1
sourcepub fn new(
builddate: BuildDate,
builddir: BuildDir,
buildenv: Vec<BuildEnv>,
format: SchemaVersion,
installed: Vec<InstalledPackage>,
options: Vec<PackageOption>,
packager: Packager,
pkgarch: Architecture,
pkgbase: Name,
pkgbuild_sha256sum: Checksum<Sha256>,
pkgname: Name,
pkgver: Version,
) -> Result<Self, Error>
pub fn new( builddate: BuildDate, builddir: BuildDir, buildenv: Vec<BuildEnv>, format: SchemaVersion, installed: Vec<InstalledPackage>, options: Vec<PackageOption>, packager: Packager, pkgarch: Architecture, pkgbase: Name, pkgbuild_sha256sum: Checksum<Sha256>, pkgname: Name, pkgver: Version, ) -> Result<Self, Error>
Create a new BuildInfoV1 from all required components
Trait Implementations§
source§impl Clone for BuildInfoV1
impl Clone for BuildInfoV1
source§fn clone(&self) -> BuildInfoV1
fn clone(&self) -> BuildInfoV1
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 BuildInfoV1
impl Debug for BuildInfoV1
source§impl<'de> Deserialize<'de> for BuildInfoV1
impl<'de> Deserialize<'de> for BuildInfoV1
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 BuildInfoV1
impl Display for BuildInfoV1
Auto Trait Implementations§
impl Freeze for BuildInfoV1
impl RefUnwindSafe for BuildInfoV1
impl !Send for BuildInfoV1
impl !Sync for BuildInfoV1
impl Unpin for BuildInfoV1
impl UnwindSafe for BuildInfoV1
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)