pub struct Package {
file_name: PackageFileName,
parent_dir: ExistingAbsoluteDir,
}
Expand description
An alpm-package file.
Tracks the PackageFileName
of the alpm-package as well as its absolute parent_dir
.
Fields§
§file_name: PackageFileName
§parent_dir: ExistingAbsoluteDir
Implementations§
Source§impl Package
impl Package
Sourcepub fn new(
file_name: PackageFileName,
parent_dir: ExistingAbsoluteDir,
) -> Result<Self, Error>
pub fn new( file_name: PackageFileName, parent_dir: ExistingAbsoluteDir, ) -> Result<Self, Error>
Sourcepub fn to_path_buf(&self) -> PathBuf
pub fn to_path_buf(&self) -> PathBuf
Returns the absolute path of the Package
.
Trait Implementations§
Source§impl TryFrom<&PackageCreationConfig> for Package
impl TryFrom<&PackageCreationConfig> for Package
Source§fn try_from(value: &PackageCreationConfig) -> Result<Self, Self::Error>
fn try_from(value: &PackageCreationConfig) -> Result<Self, Self::Error>
Creates a new Package
from a PackageCreationConfig
.
Before creating a Package
, guarantees the on-disk file consistency with the
help of available Mtree
data.
§Errors
Returns an error if
- creating a
PackageFileName
fromvalue
fails, - creating a
CompressionEncoder
fails, - creating a compressed or uncompressed package file fails,
- validating any of the paths using ALPM-MTREE data (available through
value
) fails, - appending files to a compressed or uncompressed package file fails,
- finishing a compressed or uncompressed package file fails,
- or creating a
Package
fails.
Auto Trait Implementations§
impl Freeze for Package
impl RefUnwindSafe for Package
impl Send for Package
impl Sync for Package
impl Unpin for Package
impl UnwindSafe for Package
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