pub struct ItemProgressUpdater { /* private fields */ }Expand description
Handle for reporting progress on a single item. All progress updates (both download and upload paths) go through this type.
Replaces both DownloadTaskUpdater and the per-file update logic
that was previously in CompletionTracker.
Implementations§
Source§impl ItemProgressUpdater
impl ItemProgressUpdater
Sourcepub fn new_standalone(name: &str) -> Arc<Self>
pub fn new_standalone(name: &str) -> Arc<Self>
Create a standalone updater for debug/testing purposes. Creates its own throwaway GroupProgress.
Sourcepub fn update_item_size(&self, total: u64, is_final: bool)
pub fn update_item_size(&self, total: u64, is_final: bool)
Update the total item size. When is_final is true, subsequent calls are ignored.
Sourcepub fn update_transfer_size(&self, total: u64)
pub fn update_transfer_size(&self, total: u64)
Update the total transfer (network) bytes for this item.
Sourcepub fn report_bytes_completed(&self, increment: u64)
pub fn report_bytes_completed(&self, increment: u64)
Report decompressed/processed bytes completed for this item.
Sourcepub fn report_transfer_bytes_completed(&self, increment: u64)
pub fn report_transfer_bytes_completed(&self, increment: u64)
Report transfer (network) bytes completed.
Sourcepub fn total_bytes_completed(&self) -> u64
pub fn total_bytes_completed(&self) -> u64
Read the current bytes_completed for this item.
Sourcepub fn assert_complete(&self)
pub fn assert_complete(&self)
Assert this item is fully complete (completed == total for both bytes and transfer).
pub fn item(&self) -> &Arc<ItemProgress>
pub fn report(&self) -> ItemProgressReport
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ItemProgressUpdater
impl RefUnwindSafe for ItemProgressUpdater
impl Send for ItemProgressUpdater
impl Sync for ItemProgressUpdater
impl Unpin for ItemProgressUpdater
impl UnsafeUnpin for ItemProgressUpdater
impl UnwindSafe for ItemProgressUpdater
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
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more