pub struct BuildInfoV2 {Show 15 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>,
startdir: StartDir,
buildtool: BuildTool,
buildtoolver: BuildToolVersion,
}
Expand description
BUILDINFO version 2
BuildInfoV2
is (exclusively) compatible with data following the v2 specification of the
BUILDINFO file.
§Examples
use std::str::FromStr;
use alpm_buildinfo::BuildInfoV2;
let buildinfo_data = r#"format = 2
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
startdir = /startdir/
buildtool = devtools
buildtoolver = 1:1.2.1-1-any
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 = BuildInfoV2::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>
§startdir: StartDir
§buildtool: BuildTool
§buildtoolver: BuildToolVersion
Implementations§
source§impl BuildInfoV2
impl BuildInfoV2
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 BuildInfoV2
impl BuildInfoV2
sourcepub fn new(
builddate: BuildDate,
builddir: BuildDir,
startdir: StartDir,
buildtool: BuildTool,
buildtoolver: BuildToolVersion,
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, startdir: StartDir, buildtool: BuildTool, buildtoolver: BuildToolVersion, 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 BuildInfoV2 from all required components
sourcepub fn buildtoolver(&self) -> &BuildToolVersion
pub fn buildtoolver(&self) -> &BuildToolVersion
Returns the version of the build tool.
Trait Implementations§
source§impl Clone for BuildInfoV2
impl Clone for BuildInfoV2
source§fn clone(&self) -> BuildInfoV2
fn clone(&self) -> BuildInfoV2
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 BuildInfoV2
impl Debug for BuildInfoV2
source§impl<'de> Deserialize<'de> for BuildInfoV2
impl<'de> Deserialize<'de> for BuildInfoV2
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 BuildInfoV2
impl Display for BuildInfoV2
Auto Trait Implementations§
impl Freeze for BuildInfoV2
impl RefUnwindSafe for BuildInfoV2
impl !Send for BuildInfoV2
impl !Sync for BuildInfoV2
impl Unpin for BuildInfoV2
impl UnwindSafe for BuildInfoV2
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
)