Struct PackageInput

Source
pub struct PackageInput {
    build_info: BuildInfo,
    package_info: PackageInfo,
    mtree: Mtree,
    mtree_digest: Sha256Checksum,
    input_dir: InputDir,
    scriptlet: Option<PathBuf>,
    relative_paths: Vec<PathBuf>,
}
Expand description

A package input directory.

An input directory must contain

Further, the input directory may contain an alpm-install-scriptlet file and zero or more package data files (see alpm-package).

Fields§

§build_info: BuildInfo§package_info: PackageInfo§mtree: Mtree§mtree_digest: Sha256Checksum§input_dir: InputDir§scriptlet: Option<PathBuf>§relative_paths: Vec<PathBuf>

Implementations§

Source§

impl PackageInput

Source

pub fn input_dir(&self) -> &Path

Returns the input directory of the PackageInput as Path reference.

Source

pub fn build_info(&self) -> &BuildInfo

Returns a reference to the BuildInfo data of the PackageInput.

§Note

The BuildInfo data relates directly to an on-disk file tracked by the PackageInput. This method provides access to the data as present during the creation of the PackageInput. While the data can be guaranteed to be correct, the on-disk file may have changed between creation of the PackageInput and the call of this method.

Source

pub fn package_info(&self) -> &PackageInfo

Returns a reference to the PackageInfo data of the PackageInput.

§Note

The PackageInfo data relates directly to an on-disk file tracked by the PackageInput. This method provides access to the data as present during the creation of the PackageInput. While the data can be guaranteed to be correct, the on-disk file may have changed between creation of the PackageInput and the call of this method.

Source

pub fn mtree(&self) -> Result<&Mtree, Error>

Returns a reference to the Mtree data of the PackageInput.

Compares the stored hash digest of the file with that of the file on disk.

§Errors

Returns an error if

  • the file on disk can no longer be read,
  • or the file on disk has a changed hash digest.
Source

pub fn install_scriptlet(&self) -> Option<&Path>

Returns the optional alpm-install-scriptlet of the PackageInput as Path reference.

§Note

The alpm-install-scriptlet path relates directly to an on-disk file tracked by the PackageInput. This method provides access to the data as present during the creation of the PackageInput. While the data can be guaranteed to be correct, the on-disk file may have changed between creation of the PackageInput and the call of this method.

Source

pub fn relative_paths(&self) -> &[PathBuf]

Returns all paths relative to the PackageInput’s input directory.

Source

pub fn input_paths(&self) -> Result<InputPaths<'_, '_>, Error>

Returns an InputPaths for the input directory and all relative paths contained in it.

Trait Implementations§

Source§

impl Clone for PackageInput

Source§

fn clone(&self) -> PackageInput

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 PackageInput

Source§

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

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

impl TryFrom<InputDir> for PackageInput

Source§

fn try_from(value: InputDir) -> Result<Self, Self::Error>

Creates a PackageInput from input directory path.

This function reads ALPM-MTREE, BUILDINFO and PKGINFO files in path, collects the path of an existing alpm-install-scriptlet and validates them. All data files below path are then checked against the ALPM-MTREE data.

§Errors

Returns an error if

Source§

type Error = Error

The type returned in the event of a conversion error.

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

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,