pub struct ProgressTracker {
total: Option<usize>,
transferred: usize,
callback: Option<ProgressCallback>,
interval: usize,
since_report: usize,
}Expand description
Progress tracker for transfers.
Standalone progress tracking without buffering. Useful when data flows directly to destination.
Fields§
§total: Option<usize>Total bytes expected (if known).
transferred: usizeBytes transferred.
callback: Option<ProgressCallback>Progress callback.
interval: usizeReporting interval.
since_report: usizeBytes since last report.
Implementations§
Source§impl ProgressTracker
impl ProgressTracker
Sourcepub fn set_callback(&mut self, callback: ProgressCallback)
pub fn set_callback(&mut self, callback: ProgressCallback)
Set progress callback.
Sourcepub fn set_interval(&mut self, interval: usize)
pub fn set_interval(&mut self, interval: usize)
Set reporting interval.
Sourcepub fn transferred(&self) -> usize
pub fn transferred(&self) -> usize
Get bytes transferred.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if transfer is complete.
Trait Implementations§
Source§impl Clone for ProgressTracker
impl Clone for ProgressTracker
Source§fn clone(&self) -> ProgressTracker
fn clone(&self) -> ProgressTracker
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ProgressTracker
impl RefUnwindSafe for ProgressTracker
impl Send for ProgressTracker
impl Sync for ProgressTracker
impl Unpin for ProgressTracker
impl UnwindSafe for ProgressTracker
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