alpm_buildinfo

Struct BuildInfoV1

source
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

source

pub fn format(&self) -> &SchemaVersion

Returns the format of the BUILDINFO file

source

pub fn pkgname(&self) -> &Name

Returns the package name

source

pub fn pkgbase(&self) -> &Name

Returns the package base

source

pub fn pkgver(&self) -> &Version

Returns the package version

source

pub fn pkgarch(&self) -> &Architecture

Returns the package architecture

source

pub fn pkgbuild_sha256sum(&self) -> &Checksum<Sha256>

Returns the package build SHA-256 checksum

source

pub fn packager(&self) -> &Packager

Returns the packager

source

pub fn builddate(&self) -> &BuildDate

Returns the build date

source

pub fn builddir(&self) -> &BuildDir

Returns the build directory

source

pub fn buildenv(&self) -> &Vec<BuildEnv>

Returns the build environment

source

pub fn options(&self) -> &Vec<PackageOption>

Returns the package options

source

pub fn installed(&self) -> &Vec<InstalledPackage>

Returns the installed packages

source§

impl BuildInfoV1

source

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

source§

fn clone(&self) -> BuildInfoV1

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 BuildInfoV1

source§

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

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

impl<'de> Deserialize<'de> for BuildInfoV1

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 BuildInfoV1

source§

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

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

impl FromStr for BuildInfoV1

source§

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

Create a BuildInfoV1 from a &str

§Errors

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

source§

type Err = Error

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

impl Serialize for BuildInfoV1

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

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 T)

🔬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> Serialize for T
where T: Serialize + ?Sized,

source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

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§

default 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>,

§

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

§

impl<T> MaybeSendSync for T