pub struct InstallProgress {
pub active_deps: Vec<String>,
pub completed_count: usize,
pub total_count: usize,
}Expand description
Progress update message for parallel installation operations.
This struct encapsulates the current state of a parallel installation operation, providing detailed information about which dependencies are actively being processed and the overall completion status. It’s designed for use with channel-based progress reporting systems.
§Fields
active_deps- Names of dependencies currently being processed in parallelcompleted_count- Number of dependencies that have finished processingtotal_count- Total number of dependencies to be processed
§Usage
This struct is typically sent through async channels to provide real-time progress updates to user interface components:
use agpm_cli::installer::InstallProgress;
use tokio::sync::mpsc;
let (tx, mut rx) = mpsc::unbounded_channel::<InstallProgress>();
// Installation task sends progress updates
tokio::spawn(async move {
let progress = InstallProgress {
active_deps: vec!["agent1".to_string(), "tool2".to_string()],
completed_count: 3,
total_count: 10,
};
let _ = tx.send(progress);
});
// UI task receives and displays progress
while let Some(progress) = rx.recv().await {
println!("Active: {:?}, Progress: {}/{}",
progress.active_deps,
progress.completed_count,
progress.total_count
);
}§Design Purpose
This structure enables sophisticated progress reporting that shows:
- Which specific dependencies are being processed concurrently
- Overall completion percentage for the installation operation
- Real-time updates as the parallel installation progresses
The active_deps field is particularly useful for debugging parallel
operations, as it shows exactly which resources are currently being
downloaded, validated, or installed.
Fields§
§active_deps: Vec<String>Names of dependencies currently being processed in parallel.
This vector contains the names of all resources that are actively being installed at the time this progress update was generated. The list changes dynamically as resources complete and new ones begin.
completed_count: usizeNumber of dependencies that have completed processing.
This count includes both successful installations and failed attempts. It represents the total number of resources that have finished, regardless of outcome.
total_count: usizeTotal number of dependencies to be processed in this operation.
This count remains constant throughout the installation and represents the full scope of the parallel installation operation.
Trait Implementations§
Source§impl Clone for InstallProgress
impl Clone for InstallProgress
Source§fn clone(&self) -> InstallProgress
fn clone(&self) -> InstallProgress
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more