MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / create_progress_bar

Function create_progress_bar

atomic-cli/src/output/progress.rs:118–124  ·  view source on GitHub ↗

Create a progress bar for operations with known total. Use this when you know ahead of time how many items will be processed or how many bytes will be transferred. # Arguments `total` - The total number of units to process `message` - The message to display with the progress bar # Returns A configured [`ProgressBar`] with progress styling. # Example ```rust,ignore let files = vec!["a.rs", "

(total: u64, message: &str)

Source from the content-addressed store, hash-verified

116/// progress::finish_success(&bar, "All files processed");
117/// ```
118pub fn create_progress_bar(total: u64, message: &str) -> ProgressBar {
119 let pb = ProgressBar::new(total);
120 pb.set_style(progress_style());
121 pb.set_message(message.to_string());
122 pb.enable_steady_tick(Duration::from_millis(PROGRESS_TICK_MS));
123 pb
124}
125
126/// Create a progress bar for byte-based operations (downloads, transfers).
127///

Callers 11

run_asyncMethod · 0.85
run_asyncMethod · 0.85
run_asyncMethod · 0.85
test_create_progress_barFunction · 0.85
test_set_messageFunction · 0.85
test_is_finishedFunction · 0.85
test_large_progressFunction · 0.85

Calls 1

progress_styleFunction · 0.85

Tested by 8

test_create_progress_barFunction · 0.68
test_set_messageFunction · 0.68
test_is_finishedFunction · 0.68
test_large_progressFunction · 0.68