Skip to main content

SnapshotAccumulator

Struct SnapshotAccumulator 

Source
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

Source

pub fn new() -> Self

Source

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_closure is true
  • Failed — appeared as tgt in at least one EdgeFailed
  • Pending — 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.

Source

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).

Trait Implementations§

Source§

impl Default for SnapshotAccumulator

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl EventSink for SnapshotAccumulator

Source§

fn emit(&self, event: &CascadeEvent)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V