Trait Reporter

Source
pub trait Reporter: Send + Sync {
Show 19 methods // Required methods fn on_transaction_start( &self, transaction: &Transaction<PrefixRecord, RepoDataRecord>, ); fn on_transaction_operation_start(&self, operation: usize); fn on_populate_cache_start( &self, operation: usize, record: &RepoDataRecord, ) -> usize; fn on_validate_start(&self, cache_entry: usize) -> usize; fn on_validate_complete(&self, validate_idx: usize); fn on_download_start(&self, cache_entry: usize) -> usize; fn on_download_progress( &self, download_idx: usize, progress: u64, total: Option<u64>, ); fn on_download_completed(&self, download_idx: usize); fn on_populate_cache_complete(&self, cache_entry: usize); fn on_unlink_start(&self, operation: usize, record: &PrefixRecord) -> usize; fn on_unlink_complete(&self, index: usize); fn on_link_start(&self, operation: usize, record: &RepoDataRecord) -> usize; fn on_link_complete(&self, index: usize); fn on_transaction_operation_complete(&self, operation: usize); fn on_transaction_complete(&self); fn on_post_link_start(&self, package_name: &str, script_path: &str) -> usize; fn on_post_link_complete(&self, index: usize, success: bool); fn on_pre_unlink_start( &self, package_name: &str, script_path: &str, ) -> usize; fn on_pre_unlink_complete(&self, index: usize, success: bool);
}
Expand description

A trait for reporting progress of the installation process.

Required Methods§

Source

fn on_transaction_start( &self, transaction: &Transaction<PrefixRecord, RepoDataRecord>, )

Called when the transaction starts. This is the first method called.

Source

fn on_transaction_operation_start(&self, operation: usize)

Called when a transaction operation starts. During the operation the cache is populated, previous installations are uninstalled and new installations are linked.

The operation is the index of the operation in the transaction passed to on_transaction_start.

Source

fn on_populate_cache_start( &self, operation: usize, record: &RepoDataRecord, ) -> usize

Called when starting to populate the cache for a package. This is called for any new package that will be installed. Before installation any package is first added to the cache.

The operation is the index of the operation in the transaction passed to on_transaction_start.

Source

fn on_validate_start(&self, cache_entry: usize) -> usize

Called when validation of a package starts. If a package is already present in the cache, the contents of the package is validated against its manifest, this is done to ensure that the package is not corrupted.

Source

fn on_validate_complete(&self, validate_idx: usize)

Called when validation completes. If the package is valid, the package is immediately used and no downloading is required.

The validate_idx is the value return by on_validate_start for the corresponding package.

Source

fn on_download_start(&self, cache_entry: usize) -> usize

Called when a download starts. If a package is not present in the cache or the package in the cache is corrupt, the package is downloaded. This function is called right before that happens.

The value returned by this function is passed as the download_idx to on_download_progress and on_download_complete.

The cache_entry is the value return by on_populate_cache_start for the corresponding package.

Source

fn on_download_progress( &self, download_idx: usize, progress: u64, total: Option<u64>, )

Called with regular updates on the download progress.

The download_idx is the value return by on_download_start for the corresponding download.

Source

fn on_download_completed(&self, download_idx: usize)

Called when a download completes.

The download_idx is the value return by on_download_start for the corresponding download.

Source

fn on_populate_cache_complete(&self, cache_entry: usize)

Called when the cache for a package was populated

The cache_entry is the value return by on_populate_cache_start for the corresponding package.

Called when an unlink operation started.

The operation is the index of the operation in the transaction passed to on_transaction_start.

Called when an unlink operation completed.

The index is the value return by on_unlink_start for the corresponding package.

Called when linking of a package has started

The operation is the index of the operation in the transaction passed to on_transaction_start.

Called when linking of a package completed.

The index is the value return by on_link_start for the corresponding package.

Source

fn on_transaction_operation_complete(&self, operation: usize)

Called when a transaction operation finishes.

Source

fn on_transaction_complete(&self)

Called when the transaction completes. Unless an error occurs, this is the last function that is called.

Source

fn on_post_link_start(&self, package_name: &str, script_path: &str) -> usize

Called when a post-link script starts execution.

The package_name is the name of the package whose post-link script is being executed. The script_path is the relative path to the script within the prefix.

Returns an index that will be passed to on_post_link_complete.

Source

fn on_post_link_complete(&self, index: usize, success: bool)

Called when a post-link script completes execution.

The index is the value returned by on_post_link_start for the corresponding script. The success parameter indicates whether the script executed successfully.

Called when a pre-unlink script starts execution.

The package_name is the name of the package whose pre-unlink script is being executed. The script_path is the relative path to the script within the prefix.

Returns an index that will be passed to on_pre_unlink_complete.

Called when a pre-unlink script completes execution.

The index is the value returned by on_pre_unlink_start for the corresponding script. The success parameter indicates whether the script executed successfully.

Implementors§