pub struct MultiPhaseProgress { /* private fields */ }Expand description
Multi-phase progress manager that displays multiple progress bars with completed phases showing as static messages
Implementations§
Source§impl MultiPhaseProgress
impl MultiPhaseProgress
Sourcepub fn start_phase(&self, phase: InstallationPhase, message: Option<&str>)
pub fn start_phase(&self, phase: InstallationPhase, message: Option<&str>)
Start a new phase with a spinner
Sourcepub fn start_phase_with_progress(&self, phase: InstallationPhase, total: usize)
pub fn start_phase_with_progress(&self, phase: InstallationPhase, total: usize)
Start a new phase with a progress bar
Sourcepub fn update_message(&self, message: String)
pub fn update_message(&self, message: String)
Update the message of the current phase
Sourcepub fn update_current_message(&self, message: &str)
pub fn update_current_message(&self, message: &str)
Update the current message for the active phase
Sourcepub fn increment_progress(&self, delta: u64)
pub fn increment_progress(&self, delta: u64)
Increment progress for progress bars
Sourcepub fn set_progress(&self, pos: usize)
pub fn set_progress(&self, pos: usize)
Set progress position for progress bars
Sourcepub fn complete_phase(&self, message: Option<&str>)
pub fn complete_phase(&self, message: Option<&str>)
Complete the current phase and show it as a static message
Sourcepub fn start_phase_with_active_tracking(
&self,
phase: InstallationPhase,
total: usize,
window_size: usize,
)
pub fn start_phase_with_active_tracking( &self, phase: InstallationPhase, total: usize, window_size: usize, )
Start a phase with active resource tracking window. This displays a fixed-size window showing which resources are currently being processed, along with a counter showing overall progress.
§Arguments
phase- The installation phase to starttotal- Total number of resources to installwindow_size- Number of slots in the active window (typically 5-7)
Sourcepub fn mark_item_active(&self, display_name: &str, unique_key: &str)
pub fn mark_item_active(&self, display_name: &str, unique_key: &str)
Mark an item as actively being processed (generic version). This adds the item to the first available slot in the active window.
§Arguments
display_name- The formatted display name for the itemunique_key- A unique key to track this specific item (for deduplication)
Sourcepub fn mark_resource_active(&self, entry: &LockedResource)
pub fn mark_resource_active(&self, entry: &LockedResource)
Mark a resource as actively being processed. This adds the resource to the first available slot in the active window.
§Arguments
entry- The locked resource entry with full metadata
Sourcepub fn mark_item_complete(
&self,
unique_key: &str,
display_name_fallback: Option<&str>,
completed: usize,
total: usize,
phase_name: &str,
)
pub fn mark_item_complete( &self, unique_key: &str, display_name_fallback: Option<&str>, completed: usize, total: usize, phase_name: &str, )
Mark an item as complete and update progress counter (generic version). This clears the item from its slot and updates the overall counter.
§Arguments
unique_key- The unique key for the item that was completeddisplay_name_fallback- Optional display name for fallback searchcompleted- Number of items completed so fartotal- Total number of items to processphase_name- Name of the phase for the counter message (e.g., “Installing resources”, “Resolving dependencies”)
Sourcepub fn mark_resource_complete(
&self,
entry: &LockedResource,
completed: usize,
total: usize,
)
pub fn mark_resource_complete( &self, entry: &LockedResource, completed: usize, total: usize, )
Mark a resource as complete and update progress counter. This clears the resource from its slot and updates the overall counter.
§Arguments
entry- The locked resource entry that was completedcompleted- Number of resources completed so fartotal- Total number of resources to install
Sourcepub fn complete_phase_with_window(&self, message: Option<&str>)
pub fn complete_phase_with_window(&self, message: Option<&str>)
Complete phase with active window, showing final summary. This is similar to complete_phase but also clears the active window.
Sourcepub fn calculate_window_size(concurrency: usize) -> usize
pub fn calculate_window_size(concurrency: usize) -> usize
Calculate optimal window size based on concurrency and terminal constraints. Returns a size between 3 and 10, with 7 as a reasonable default.
Sourcepub fn suspend<F, R>(&self, f: F) -> Rwhere
F: FnOnce() -> R,
pub fn suspend<F, R>(&self, f: F) -> Rwhere
F: FnOnce() -> R,
Suspend progress display temporarily to execute a closure. This is useful for printing output that should appear outside the progress display.
Sourcepub fn add_progress_bar(&self, total: u64) -> Option<IndicatifBar>
pub fn add_progress_bar(&self, total: u64) -> Option<IndicatifBar>
Create a subordinate progress bar for detailed progress within a phase
Trait Implementations§
Source§impl Clone for MultiPhaseProgress
impl Clone for MultiPhaseProgress
Source§fn clone(&self) -> MultiPhaseProgress
fn clone(&self) -> MultiPhaseProgress
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more