pub struct ProgressTracker { /* private fields */ }Expand description
Progress tracker for downloads
Implementations§
Source§impl ProgressTracker
impl ProgressTracker
Sourcepub fn with_progress_bar(total_size: u64) -> Self
pub fn with_progress_bar(total_size: u64) -> Self
Create a new progress tracker with visual progress bar
Sourcepub async fn set_callback<F>(&self, callback: F)
pub async fn set_callback<F>(&self, callback: F)
Set a progress callback
Sourcepub async fn init_chunks(&self, chunk_ranges: Vec<(u64, u64)>)
pub async fn init_chunks(&self, chunk_ranges: Vec<(u64, u64)>)
Initialize chunks for parallel downloading
Sourcepub async fn update_chunk(&self, chunk_id: usize, bytes_downloaded: u64)
pub async fn update_chunk(&self, chunk_id: usize, bytes_downloaded: u64)
Update progress for a specific chunk
Sourcepub async fn complete_chunk(&self, chunk_id: usize)
pub async fn complete_chunk(&self, chunk_id: usize)
Mark a chunk as complete
Sourcepub async fn update(&self, bytes_downloaded: u64)
pub async fn update(&self, bytes_downloaded: u64)
Update total progress (for single-threaded downloads)
Sourcepub async fn get_progress(&self) -> ProgressInfo
pub async fn get_progress(&self) -> ProgressInfo
Get current progress information
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProgressTracker
impl !RefUnwindSafe for ProgressTracker
impl Send for ProgressTracker
impl Sync for ProgressTracker
impl Unpin for ProgressTracker
impl UnsafeUnpin 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