Expand description
Core primitives for tracking progress state.
This module defines the Progress struct, which acts as the central handle for
updates. It is designed around a “Hot/Cold” split to maximize performance in
multi-threaded environments:
- Hot Data: Position, Total, and Finished state are stored in
Atomicprimitives. This allows high-frequency updates (e.g., in tight loops) without locking contention. - Cold Data: Metadata like names, current items, and error states are guarded by
an
RwLock. These are accessed less frequently, typically only by the rendering thread or when significant state changes occur.
§Snapshots
To render progress safely, use Progress::snapshot to obtain a ProgressSnapshot.
This provides a consistent, immutable view of the progress state at a specific instant,
calculating derived metrics like ETA and throughput automatically.
Structs§
- Cold
- “Cold” storage for metadata that changes infrequently.
- Progress
- A thread-safe, cloneable handle to a progress indicator.
- Progress
Snapshot - A plain-data snapshot of a
Progressstate at a specific point in time.
Enums§
- Progress
Type - Defines the behavior/visualization hint for the progress indicator.