pub struct PackageCreationConfig {
package_input: PackageInput,
output_dir: OutputDir,
compression: Option<CompressionSettings>,
}
Expand description
A config that tracks the components needed for the creation of an alpm-package from input directory.
Tracks a PackageInput
, optional CompressionSettings
and an OutputDir
in which an
alpm-package is placed after creation.
Fields§
§package_input: PackageInput
§output_dir: OutputDir
§compression: Option<CompressionSettings>
Implementations§
Source§impl PackageCreationConfig
impl PackageCreationConfig
Sourcepub fn new(
package_input: PackageInput,
output_dir: OutputDir,
compression: Option<CompressionSettings>,
) -> Result<Self, Error>
pub fn new( package_input: PackageInput, output_dir: OutputDir, compression: Option<CompressionSettings>, ) -> Result<Self, Error>
Creates a new PackageCreationConfig
.
§Errors
Returns an error if
package_input.input_dir
is equal tooutput_dir
,package_input.input_dir
is located inside ofoutput_dir
,- or
output_dir
is located inside ofpackage_input.input_dir
.
Sourcepub fn package_input(&self) -> &PackageInput
pub fn package_input(&self) -> &PackageInput
Returns a reference to the PackageInput
.
Sourcepub fn output_dir(&self) -> &OutputDir
pub fn output_dir(&self) -> &OutputDir
Returns a reference to the OutputDir
.
Sourcepub fn compression(&self) -> Option<&CompressionSettings>
pub fn compression(&self) -> Option<&CompressionSettings>
Returns a reference to the CompressionSettings
.
Trait Implementations§
Source§impl Clone for PackageCreationConfig
impl Clone for PackageCreationConfig
Source§fn clone(&self) -> PackageCreationConfig
fn clone(&self) -> PackageCreationConfig
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 PackageCreationConfig
impl Debug for PackageCreationConfig
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.
Source§impl TryFrom<&PackageCreationConfig> for PackageFileName
impl TryFrom<&PackageCreationConfig> for PackageFileName
Source§fn try_from(value: &PackageCreationConfig) -> Result<Self, Self::Error>
fn try_from(value: &PackageCreationConfig) -> Result<Self, Self::Error>
Creates a PackageFileName
from a reference to a PackageCreationConfig
.
§Errors
Returns an error if the PackageInfo
tracked by value
is no longer valid or present.
Auto Trait Implementations§
impl Freeze for PackageCreationConfig
impl RefUnwindSafe for PackageCreationConfig
impl Send for PackageCreationConfig
impl Sync for PackageCreationConfig
impl Unpin for PackageCreationConfig
impl UnwindSafe for PackageCreationConfig
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