pub struct GroupProgress {
pub total_bytes: AtomicU64,
pub total_bytes_completed: AtomicU64,
pub total_transfer_bytes: AtomicU64,
pub total_transfer_bytes_completed: AtomicU64,
/* private fields */
}Expand description
Aggregate progress across all items, with an item registry. Owns the atomic group-level counters and a map of per-item progress.
Fields§
§total_bytes: AtomicU64§total_bytes_completed: AtomicU64§total_transfer_bytes: AtomicU64§total_transfer_bytes_completed: AtomicU64Implementations§
Source§impl GroupProgress
impl GroupProgress
Sourcepub fn new() -> Arc<Self>
pub fn new() -> Arc<Self>
Create a group progress tracker using default speed estimation parameters.
Sourcepub fn with_speed_config(
half_life: Duration,
min_observations: u32,
) -> Arc<Self>
pub fn with_speed_config( half_life: Duration, min_observations: u32, ) -> Arc<Self>
Create a group progress tracker with explicit speed estimation parameters.
Sourcepub fn new_item(
self: &Arc<Self>,
id: UniqueID,
name: impl Into<Arc<str>>,
) -> Arc<ItemProgressUpdater>
pub fn new_item( self: &Arc<Self>, id: UniqueID, name: impl Into<Arc<str>>, ) -> Arc<ItemProgressUpdater>
Create a new tracked item and register it in the items map.
Returns an ItemProgressUpdater handle for the caller to report progress.
Sourcepub fn new_completion_tracker(self: &Arc<Self>) -> CompletionTracker
pub fn new_completion_tracker(self: &Arc<Self>) -> CompletionTracker
Create a new CompletionTracker backed by this group’s progress.
Sourcepub fn report(&self) -> GroupProgressReport
pub fn report(&self) -> GroupProgressReport
Snapshot of aggregate progress. Reads completions first (Acquire), then totals to reduce transient sampling skew.
Speed is estimated via [SpeedTracker], which uses an exponentially-weighted
moving average to produce smoothed bytes-per-second rates.
This call updates internal speed-estimation state, so repeated calls are
not strictly idempotent. Rate fields remain None until enough speed
observations have been collected.
Sourcepub fn item_reports(&self) -> HashMap<UniqueID, ItemProgressReport>
pub fn item_reports(&self) -> HashMap<UniqueID, ItemProgressReport>
Snapshot of all per-item progress.
Sourcepub fn item_report(&self, id: UniqueID) -> Option<ItemProgressReport>
pub fn item_report(&self, id: UniqueID) -> Option<ItemProgressReport>
Snapshot of one item’s progress.
Sourcepub fn assert_complete(&self)
pub fn assert_complete(&self)
Debug verification that all items are complete.
Trait Implementations§
Source§impl Debug for GroupProgress
impl Debug for GroupProgress
Auto Trait Implementations§
impl !Freeze for GroupProgress
impl RefUnwindSafe for GroupProgress
impl Send for GroupProgress
impl Sync for GroupProgress
impl Unpin for GroupProgress
impl UnsafeUnpin for GroupProgress
impl UnwindSafe for GroupProgress
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
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>
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>
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