pub struct DownloadProgress {
pub total_bytes: u64,
pub downloaded_bytes: u64,
pub speed_bps: f64,
pub eta_secs: f64,
pub is_complete: bool,
pub started_at: Instant,
}Expand description
Download progress information
Fields§
§total_bytes: u64Total bytes to download
downloaded_bytes: u64Bytes downloaded so far
speed_bps: f64Download speed (bytes per second)
eta_secs: f64Estimated time remaining (seconds)
is_complete: boolWhether download is complete
started_at: InstantStart time
Implementations§
Source§impl DownloadProgress
impl DownloadProgress
Sourcepub fn speed_human(&self) -> String
pub fn speed_human(&self) -> String
Get human-readable speed
Sourcepub fn downloaded_human(&self) -> String
pub fn downloaded_human(&self) -> String
Get human-readable downloaded size
Sourcepub fn total_human(&self) -> String
pub fn total_human(&self) -> String
Get human-readable total size
Sourcepub fn progress_bar(&self, width: usize) -> String
pub fn progress_bar(&self, width: usize) -> String
Format progress bar (width characters)
Trait Implementations§
Source§impl Clone for DownloadProgress
impl Clone for DownloadProgress
Source§fn clone(&self) -> DownloadProgress
fn clone(&self) -> DownloadProgress
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DownloadProgress
Auto Trait Implementations§
impl Freeze for DownloadProgress
impl RefUnwindSafe for DownloadProgress
impl Send for DownloadProgress
impl Sync for DownloadProgress
impl Unpin for DownloadProgress
impl UnsafeUnpin for DownloadProgress
impl UnwindSafe for DownloadProgress
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