pub(crate) struct Installer {
pub(crate) bin_dir: PathBuf,
}Expand description
Handles downloading, verifying, and placing extension binaries.
Fields§
§bin_dir: PathBufDirectory where extension binaries are installed.
Implementations§
Source§impl Installer
impl Installer
pub(crate) fn from_env(exe_dir: Option<&Path>) -> Result<Self, InstallerError>
Sourcepub(crate) fn install(
&self,
extension: &str,
source: &InstallSource,
dry_run: bool,
quiet: bool,
) -> Result<InstallResult, InstallerError>
pub(crate) fn install( &self, extension: &str, source: &InstallSource, dry_run: bool, quiet: bool, ) -> Result<InstallResult, InstallerError>
Installs an extension and returns the installed version and description.
Sourcepub(crate) fn check_latest_version(
source: &InstallSource,
installed_version: Option<&str>,
) -> Result<Option<String>, InstallerError>
pub(crate) fn check_latest_version( source: &InstallSource, installed_version: Option<&str>, ) -> Result<Option<String>, InstallerError>
Checks if a newer version is available without installing.
Returns Some(latest_version) if the manifest version is strictly
newer, None if already up to date.
Sourcepub(crate) fn install_if_changed(
&self,
extension: &str,
source: &InstallSource,
installed_version: Option<&str>,
) -> Result<Option<InstallResult>, InstallerError>
pub(crate) fn install_if_changed( &self, extension: &str, source: &InstallSource, installed_version: Option<&str>, ) -> Result<Option<InstallResult>, InstallerError>
Installs an extension only if the manifest version is newer than
installed_version. Returns Some(result) if an update was
performed, None if already at the latest version.
Sourcefn install_inner(
&self,
extension: &str,
source: &InstallSource,
manifest: Option<ReleaseManifest>,
dry_run: bool,
quiet: bool,
) -> Result<InstallResult, InstallerError>
fn install_inner( &self, extension: &str, source: &InstallSource, manifest: Option<ReleaseManifest>, dry_run: bool, quiet: bool, ) -> Result<InstallResult, InstallerError>
Shared implementation for install and install_if_changed.
Sourcepub(crate) fn remove(
&self,
extension: &str,
dry_run: bool,
) -> Result<(), InstallerError>
pub(crate) fn remove( &self, extension: &str, dry_run: bool, ) -> Result<(), InstallerError>
Removes an extension’s binary and skill files.
Sourcefn resolve_install(
&self,
extension: &str,
source: &InstallSource,
pre_manifest: Option<ReleaseManifest>,
dry_run: bool,
quiet: bool,
) -> Result<ResolvedInstall, InstallerError>
fn resolve_install( &self, extension: &str, source: &InstallSource, pre_manifest: Option<ReleaseManifest>, dry_run: bool, quiet: bool, ) -> Result<ResolvedInstall, InstallerError>
Fetches the manifest, downloads the binary, and verifies checksums/signatures.
Sourcefn copy_binary(
&self,
resolved: &ResolvedInstall,
dry_run: bool,
quiet: bool,
) -> Result<(), InstallerError>
fn copy_binary( &self, resolved: &ResolvedInstall, dry_run: bool, quiet: bool, ) -> Result<(), InstallerError>
Atomically places the downloaded binary at its destination path.
Sourcefn remove_binary(
&self,
binary: &str,
dry_run: bool,
) -> Result<(), InstallerError>
fn remove_binary( &self, binary: &str, dry_run: bool, ) -> Result<(), InstallerError>
Deletes the named binary from bin_dir.
Sourcefn ensure_dirs(&self, dry_run: bool) -> Result<(), InstallerError>
fn ensure_dirs(&self, dry_run: bool) -> Result<(), InstallerError>
Creates bin_dir if it doesn’t exist and verifies it is writable.
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 UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn propagate_header(self, header: HeaderName) -> PropagateHeader<Self>where
Self: Sized,
fn propagate_header(self, header: HeaderName) -> PropagateHeader<Self>where
Self: Sized,
propagate-header only.§fn add_extension<T>(self, value: T) -> AddExtension<Self, T>where
Self: Sized,
fn add_extension<T>(self, value: T) -> AddExtension<Self, T>where
Self: Sized,
add-extension only.§fn map_request_body<F>(self, f: F) -> MapRequestBody<Self, F>where
Self: Sized,
fn map_request_body<F>(self, f: F) -> MapRequestBody<Self, F>where
Self: Sized,
map-request-body only.§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
map-response-body only.§fn compression(self) -> Compression<Self>where
Self: Sized,
fn compression(self) -> Compression<Self>where
Self: Sized,
compression-br or compression-deflate or compression-gzip or compression-zstd only.§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
decompression-br or decompression-deflate or decompression-gzip or decompression-zstd only.§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
trace only.§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
trace only.§fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
follow-redirect only.§fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
sensitive-headers only.§fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
sensitive-headers only.§fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
sensitive-headers only.§fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
set-header only.§fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
set-header only.§fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
set-header only.§fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
set-header only.§fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
set-header only.§fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
set-header only.§fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
request-id only.§fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
request-id only.x-request-id as the header name. Read more§fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
request-id only.§fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
request-id only.x-request-id as the header name. Read more§fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
Self: Sized,
fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
Self: Sized,
catch-panic only.500 Internal Server responses. Read more§fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
limit only.413 Payload Too Large responses. Read more§fn trim_trailing_slash(self) -> NormalizePath<Self>where
Self: Sized,
fn trim_trailing_slash(self) -> NormalizePath<Self>where
Self: Sized,
normalize-path only.§fn append_trailing_slash(self) -> NormalizePath<Self>where
Self: Sized,
fn append_trailing_slash(self) -> NormalizePath<Self>where
Self: Sized,
normalize-path only.§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes