pub struct OperationProgress {
pub total_size: Option<u64>,
/* private fields */
}Expand description
Operation progress tracker.
Fields§
§total_size: Option<u64>Total size (if known).
Implementations§
Source§impl OperationProgress
impl OperationProgress
Sourcepub fn new(total_size: Option<u64>, stale_timeout: Duration) -> Self
pub fn new(total_size: Option<u64>, stale_timeout: Duration) -> Self
Create new operation progress.
Sourcepub fn progress_percent(&self) -> Option<f64>
pub fn progress_percent(&self) -> Option<f64>
Get progress percentage.
Sourcepub fn transfer_rate(&self) -> u64
pub fn transfer_rate(&self) -> u64
Calculate transfer rate in bytes per second.
Returns 0 if no time has elapsed or no data transferred.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for OperationProgress
impl RefUnwindSafe for OperationProgress
impl Send for OperationProgress
impl Sync for OperationProgress
impl Unpin for OperationProgress
impl UnsafeUnpin for OperationProgress
impl UnwindSafe for OperationProgress
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