pub struct Progress { /* private fields */ }Expand description
A handle a route reports its progress through.
Cheap to clone: clones share one set of counters, so the caller keeps one clone to poll and hands another to the route. A handle is for one run; within a pass the counters only grow, and a second run on the same handle would start from the first run’s totals. A watch start is the one run with two passes: its closing verification restarts the walk counters.
Relaxed atomics, except the once-per-run flag that publishes the analysis denominator
(Release and Acquire) and the phase, which a new pass stores with Release after
zeroing the counters and a snapshot reads with Acquire before them. Each counter is
read on its own, so no other ordering between them is promised; see
ProgressSnapshot.
Implementations§
Source§impl Progress
impl Progress
Sourcepub fn new() -> Self
pub fn new() -> Self
A fresh handle: phase ProgressPhase::Starting, every counter zero, no analysis.
Sourcepub fn snapshot(&self) -> ProgressSnapshot
pub fn snapshot(&self) -> ProgressSnapshot
Read every counter and the current phase.
Safe to call from any thread at any rate; each call is a handful of atomic loads.