pub struct ProgressUtils;
Expand description
Progress calculation utilities
Implementations§
Source§impl ProgressUtils
impl ProgressUtils
Sourcepub fn calculate_percentage(processed: u64, total: u64) -> f64
pub fn calculate_percentage(processed: u64, total: u64) -> f64
Calculate progress percentage
Sourcepub fn calculate_speed(bytes: u64, duration: Duration) -> u64
pub fn calculate_speed(bytes: u64, duration: Duration) -> u64
Calculate speed (bytes per second)
Sourcepub fn estimate_remaining_time(
processed: u64,
total: u64,
elapsed: Duration,
) -> Option<Duration>
pub fn estimate_remaining_time( processed: u64, total: u64, elapsed: Duration, ) -> Option<Duration>
Estimate remaining time
Sourcepub fn create_progress_bar(percentage: f64, width: usize) -> String
pub fn create_progress_bar(percentage: f64, width: usize) -> String
Create progress bar string
Auto Trait Implementations§
impl Freeze for ProgressUtils
impl RefUnwindSafe for ProgressUtils
impl Send for ProgressUtils
impl Sync for ProgressUtils
impl Unpin for ProgressUtils
impl UnwindSafe for ProgressUtils
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more