pub struct Installer { /* private fields */ }Expand description
An installer that can install packages into a prefix.
Implementations§
Source§impl Installer
impl Installer
Sourcepub fn with_io_concurrency_limit(self, limit: usize) -> Self
pub fn with_io_concurrency_limit(self, limit: usize) -> Self
Sets an optional IO concurrency limit. This is used to make sure that the system doesn’t acquire more IO resources than the system has available.
Sourcepub fn set_io_concurrency_limit(&mut self, limit: usize) -> &mut Self
pub fn set_io_concurrency_limit(&mut self, limit: usize) -> &mut Self
Sets an optional IO concurrency limit.
This function is similar to Self::with_io_concurrency_limit,
but modifies an existing instance.
Sourcepub fn with_io_concurrency_semaphore(
self,
io_concurrency_semaphore: Arc<Semaphore>,
) -> Self
pub fn with_io_concurrency_semaphore( self, io_concurrency_semaphore: Arc<Semaphore>, ) -> Self
Sets an optional IO concurrency semaphore. This is used to make sure that the system doesn’t acquire more IO resources than the system has available.
Sourcepub fn set_io_concurrency_semaphore(&mut self, limit: usize) -> &mut Self
pub fn set_io_concurrency_semaphore(&mut self, limit: usize) -> &mut Self
Sets an optional IO concurrency semaphore.
This function is similar to Self::with_io_concurrency_semaphore, but
modifies an existing instance.
Sourcepub fn with_execute_link_scripts(self, execute: bool) -> Self
pub fn with_execute_link_scripts(self, execute: bool) -> Self
Sets whether to execute link scripts or not.
By default, link scripts are not executed. Link scripts can run arbitrary code during the installation phase which makes them a security risk.
Sourcepub fn set_execute_link_scripts(&mut self, execute: bool) -> &mut Self
pub fn set_execute_link_scripts(&mut self, execute: bool) -> &mut Self
Sets whether to execute link scripts or not.
By default, link scripts are not executed. Link scripts can run arbitrary code during the installation phase which makes them a security risk.
Sourcepub fn with_package_cache(self, package_cache: PackageCache) -> Self
pub fn with_package_cache(self, package_cache: PackageCache) -> Self
Sets the package cache to use.
Sourcepub fn set_package_cache(&mut self, package_cache: PackageCache) -> &mut Self
pub fn set_package_cache(&mut self, package_cache: PackageCache) -> &mut Self
Sets the package cache to use.
This function is similar to Self::with_package_cache,but modifies an
existing instance.
Sourcepub fn with_download_client(self, downloader: impl Into<LazyClient>) -> Self
pub fn with_download_client(self, downloader: impl Into<LazyClient>) -> Self
Sets the download client to use
Sourcepub fn set_download_client(
&mut self,
downloader: impl Into<LazyClient>,
) -> &mut Self
pub fn set_download_client( &mut self, downloader: impl Into<LazyClient>, ) -> &mut Self
Sets the download client to use
This function is similar to Self::with_download_client, but modifies
an existing instance.
Sourcepub fn with_reporter<R: Reporter + 'static>(self, reporter: R) -> Self
pub fn with_reporter<R: Reporter + 'static>(self, reporter: R) -> Self
Sets a reporter that will receive events during the installation process.
Sourcepub fn set_reporter<R: Reporter + 'static>(&mut self, reporter: R) -> &mut Self
pub fn set_reporter<R: Reporter + 'static>(&mut self, reporter: R) -> &mut Self
Sets a reporter that will receive events during the installation process.
This function is similar to Self::with_reporter,but modifies an
existing instance.
Sourcepub fn with_installed_packages(self, installed: Vec<PrefixRecord>) -> Self
pub fn with_installed_packages(self, installed: Vec<PrefixRecord>) -> Self
Sets the packages that are currently installed in the prefix. If this is not set, the installation process will first figure this out.
Sourcepub fn with_reinstall_packages(self, reinstall: HashSet<PackageName>) -> Self
pub fn with_reinstall_packages(self, reinstall: HashSet<PackageName>) -> Self
Set the packages that we want explicitly to be reinstalled.
Sourcepub fn set_reinstall_packages(
&mut self,
reinstall: HashSet<PackageName>,
) -> &mut Self
pub fn set_reinstall_packages( &mut self, reinstall: HashSet<PackageName>, ) -> &mut Self
Set the packages that we want explicitly to be reinstalled.
This function is similar to Self::with_reinstall_packages,but
modifies an existing instance.
Sourcepub fn with_ignored_packages(self, ignored: HashSet<PackageName>) -> Self
pub fn with_ignored_packages(self, ignored: HashSet<PackageName>) -> Self
Set the packages that should be ignored (left untouched) during installation. Ignored packages will not be removed, installed, or updated.
Sourcepub fn set_ignored_packages(
&mut self,
ignored: HashSet<PackageName>,
) -> &mut Self
pub fn set_ignored_packages( &mut self, ignored: HashSet<PackageName>, ) -> &mut Self
Set the packages that should be ignored (left untouched) during
installation. Ignored packages will not be removed, installed, or
updated. This function is similar to
Self::with_ignored_packages, but modifies an existing instance.
Sourcepub fn set_installed_packages(
&mut self,
installed: Vec<PrefixRecord>,
) -> &mut Self
pub fn set_installed_packages( &mut self, installed: Vec<PrefixRecord>, ) -> &mut Self
Sets the packages that are currently installed in the prefix. If this is not set, the installation process will first figure this out.
This function is similar to Self::with_installed_packages,but
modifies an existing instance.
Sourcepub fn with_target_platform(self, target_platform: Platform) -> Self
pub fn with_target_platform(self, target_platform: Platform) -> Self
Sets the target platform of the installation. If not specifically set this will default to the current platform.
Sourcepub fn set_target_platform(&mut self, target_platform: Platform) -> &mut Self
pub fn set_target_platform(&mut self, target_platform: Platform) -> &mut Self
Sets the target platform of the installation. If not specifically set this will default to the current platform.
This function is similar to Self::with_target_platform, but modifies
an existing instance.
Sourcepub fn with_apple_code_signing_behavior(
self,
behavior: AppleCodeSignBehavior,
) -> Self
pub fn with_apple_code_signing_behavior( self, behavior: AppleCodeSignBehavior, ) -> Self
Determines how to handle Apple code signing behavior.
Sourcepub fn set_apple_code_signing_behavior(
&mut self,
behavior: AppleCodeSignBehavior,
) -> &mut Self
pub fn set_apple_code_signing_behavior( &mut self, behavior: AppleCodeSignBehavior, ) -> &mut Self
Determines how to handle Apple code signing behavior.
This function is similar to
Self::with_apple_code_signing_behavior,but modifies an existing
instance.
Sourcepub fn with_link_options(self, options: LinkOptions) -> Self
pub fn with_link_options(self, options: LinkOptions) -> Self
Sets the link options for the installer.
Sourcepub fn set_link_options(&mut self, options: LinkOptions) -> &mut Self
pub fn set_link_options(&mut self, options: LinkOptions) -> &mut Self
Sets the link options for the installer.
Sourcepub fn with_requested_specs(self, specs: Vec<MatchSpec>) -> Self
pub fn with_requested_specs(self, specs: Vec<MatchSpec>) -> Self
Sets the requested specs for the installer. These will be used to
populate the requested_spec field in generated PrefixRecord
instances.
Sourcepub fn set_requested_specs(&mut self, specs: Vec<MatchSpec>) -> &mut Self
pub fn set_requested_specs(&mut self, specs: Vec<MatchSpec>) -> &mut Self
Sets the requested specs for the installer. These will be used to
populate the requested_spec field in generated PrefixRecord
instances.
Sourcepub async fn install(
self,
prefix: impl AsRef<Path>,
records: impl IntoIterator<Item = RepoDataRecord>,
) -> Result<InstallationResult, InstallerError>
pub async fn install( self, prefix: impl AsRef<Path>, records: impl IntoIterator<Item = RepoDataRecord>, ) -> Result<InstallationResult, InstallerError>
Install the packages in the given prefix.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Installer
impl !RefUnwindSafe for Installer
impl Send for Installer
impl Sync for Installer
impl Unpin for Installer
impl !UnwindSafe for Installer
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more