Skip to main content

progress_reading

Function progress_reading 

Source
pub fn progress_reading(
    done: u64,
    total: u64,
    elapsed: Option<Duration>,
) -> String
Expand description

The words beside a determinate bar: what is done over what there is, then the whole seconds the wait has taken when that is known.

Never a remaining time, an arrival time or a rate, for Awaiting’s reason. The numbers are raw, in the description’s unit. Padding between the bar and the reading is the host’s.

assert_eq!(progress_reading(17, 40, None), "17/40");
assert_eq!(progress_reading(17, 40, Some(Duration::from_millis(4900))), "17/40  4s");