MCPcopy Create free account
hub / github.com/Proryanator/encoder-benchmark / set_bar_style

Function set_bar_style

engine/src/progressbar.rs:162–173  ·  view source on GitHub ↗
(bar: &ProgressBar, color: &str)

Source from the content-addressed store, hash-verified

160}
161
162pub fn set_bar_style(bar: &ProgressBar, color: &str) {
163 let template =
164 "{spinner:.%} [{elapsed_precise}] [{wide_bar:.%}] {pos}/{len} frames ({eta_precise})";
165 bar.set_style(
166 ProgressStyle::with_template(&str::replace(template, "%", color).as_str())
167 .unwrap()
168 .with_key("eta", |state: &ProgressState, w: &mut dyn Write| {
169 write!(w, "{:.1}s", state.eta().as_secs_f64()).unwrap()
170 })
171 .progress_chars("#>-"),
172 );
173}
174
175pub fn draw_yellow_bar(total_frames: u64) {
176 let bar = ProgressBar::new(total_frames);

Callers 2

watch_encode_progressFunction · 0.85
draw_yellow_barFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected