pub trait InstallObserver {
// Required method
fn choose_package(
&mut self,
query: &str,
matches: &[CatalogPackage],
) -> Result<usize>;
// Provided methods
fn on_start(&mut self, _total_bytes: Option<u64>) { ... }
fn on_progress(&mut self, _downloaded_bytes: u64) { ... }
fn on_install_start(&mut self, _message: &str) { ... }
fn on_install_complete(&mut self) { ... }
fn confirm_runtime_bootstrap(
&mut self,
runtime_name: &str,
target_dir: &Path,
) -> Result<bool> { ... }
}Expand description
Interactive hooks used by the installation pipeline.
The install flow uses this trait for the pieces of user interaction it needs to support. Package selection is required; the remaining hooks are optional and default to no-op behavior so callers only override the phases they care about.
Required Methods§
Sourcefn choose_package(
&mut self,
query: &str,
matches: &[CatalogPackage],
) -> Result<usize>
fn choose_package( &mut self, query: &str, matches: &[CatalogPackage], ) -> Result<usize>
Choose one package from the catalog matches returned for a reference.
The callback receives the original query string and the resolved match set. Return the index of the package to install from the provided slice.
Provided Methods§
Sourcefn on_start(&mut self, _total_bytes: Option<u64>)
fn on_start(&mut self, _total_bytes: Option<u64>)
Signal that installer download is about to start.
total_bytes is Some when the server provided a content length and
None when the size is unknown ahead of time.
Sourcefn on_progress(&mut self, _downloaded_bytes: u64)
fn on_progress(&mut self, _downloaded_bytes: u64)
Report cumulative installer download progress in bytes.
Sourcefn on_install_start(&mut self, _message: &str)
fn on_install_start(&mut self, _message: &str)
Signal that the post-download install phase is starting.
Sourcefn on_install_complete(&mut self)
fn on_install_complete(&mut self)
Signal that the post-download install phase has completed.
The engine work has finished, but the install flow may still continue with commit, journal, and shim publication before returning.