pub struct SnapshotAccumulator { /* private fields */ }Expand description
Folds CascadeEvents into per-node snapshots that can be rendered as a
cascade tree.
Implementations§
Source§impl SnapshotAccumulator
impl SnapshotAccumulator
pub fn new() -> Self
Sourcepub fn to_tree(&self) -> OwnedTreeNode
pub fn to_tree(&self) -> OwnedTreeNode
Build a self-contained OwnedTreeNode tree.
Root = seeded[0] (or an artificial root labelled “cascade” if no
Started event was received). Children are nodes whose parent edge
(EdgeCompleted or EdgeFailed) established src→tgt. Nodes that
appear in both EdgeCompleted and EdgeFailed keep their last status.
Status per node:
Ok—has_closureis trueFailed— appeared astgtin at least oneEdgeFailedPending— neither
Judgment call on orphan failed nodes: both EdgeCompleted and
EdgeFailed contribute to parent-of relationships so that failed
targets still appear in the tree. If we only used EdgeCompleted,
failed nodes would be orphans and invisible.
Sourcepub fn status_counts(&self) -> (usize, usize, usize, usize)
pub fn status_counts(&self) -> (usize, usize, usize, usize)
Aggregate counts per status: (ok, in_progress, pending, failed).
Used by LiveTreeRenderer to render the nom-style summary
row at the bottom of each frame: ∑ N✔ M⏵ K⏸ J⚠.
Pending is computed as total_nodes - (ok + in_progress + failed)
so untouched nodes (which never appear in the events map until
the strategy schedules them) show up correctly in the summary.
Falls back to nodes.values().count() if no Started event
has been seen yet (degenerate case — defensive).