Skip to main content

Module context

Module context 

Source
Expand description

ReadoutContext — the data facade every readout draws from. See SRD-63 §2.

Subject-kind validation is keyed off the firing EventType (via EventType::subject_kind) — one source of truth, no parallel ctx.subject_kind() that could drift. Builtins declare which kinds they accept via Readout::accepts; the binder rejects mis-matches at bake-time so a workload mistakenly binding phase_status to on_session_end fails loudly rather than rendering silent zeros.

The trait is one flat surface (rather than four per-kind traits) because every renderer takes &dyn ReadoutContext and runtime-downcasting between traits is hostile to call sites. Accessors that don’t apply to every kind have defaults that return zero / empty so a context impl only fills the slots its kind actually owns.

Enums§

LifecycleState
Lifecycle state of the subject (phase / iteration / scope / session) the readout is rendering for. See SRD-63 §2.

Traits§

ReadoutContext
The data facade a Readout reads from. A single implementation per surface (terminal observer, TUI, post-run summary, …) covers every readout in the registry; per-event contexts (the SessionSummaryContext in nmbrs-tui, the per-phase contexts in crate::readout_context) populate the slots that apply to their [SubjectKind].