pub struct Observer { /* private fields */ }Expand description
A read-only, cloneable view of a phase and its subtree, usable from any thread. Holding one keeps the job’s records alive.
Implementations§
Source§impl Observer
impl Observer
Sourcepub fn summary(&self) -> Summary
pub fn summary(&self) -> Summary
Read weighted progress without allocating or copying phase names. Walks this subtree; sample at a display cadence, not on every report.
Sourcepub fn try_summary(&self) -> Option<Summary>
pub fn try_summary(&self) -> Option<Summary>
Read a summary without waiting for a metadata lock. Retry on a later turn.
Sourcepub fn snapshot(&self) -> Snapshot
pub fn snapshot(&self) -> Snapshot
Take a snapshot now.
Each phase’s metadata is internally consistent; counters in different phases are read one after another, not atomically together. A finished subtree’s snapshot is frozen. This allocates and walks the subtree, so the caller chooses how often to sample.
Sourcepub fn try_snapshot(&self) -> Option<Snapshot>
pub fn try_snapshot(&self) -> Option<Snapshot>
Take a snapshot without waiting for a lock held by another thread.
Returns None if any phase’s metadata is being replaced at that moment;
try again on a later UI or event-loop turn. It never spins. Without
std, entry into the platform’s critical section is up to its provider;
allocation and the tree walk happen outside it.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Whether the phase has an outcome, without walking the tree.