Expand description
TUI-driving RunObserver implementation.
TuiObserver is the glue layer between
nmbrs_runtime::observer::RunObserver (lifecycle callbacks
emitted by the runner) and the rest of this crate
(crate::run_state_actor, crate::reporter::TuiReporter,
crate::app::App). The runner only knows about the trait;
this module owns the translation of trait callbacks into
crate::run_state_actor::RunStateCmd messages sent to the
display-side actor.
Lifecycle:
- Persona spawns the RunState actor (via
crate::run_state_actor::spawn_run_state_actor), constructs aTuiObserverholding the resultingcrate::run_state_actor::RunStateHandle, and hands it tonmbrs_runtime::runner::run_with_observer. - The runner calls
phase_starting/phase_progress/phase_completed/log/ etc. as the workload runs; each call sends one or moreRunStateCmds into the actor’s inbox — no write lock anywhere. - The first
phase_startingtriggersTuiObserver::ensure_tui_startedwhich spawns thecrate::app::Appthread (also a snapshot reader and command sender); pre-phase work runs with plain stderr output so a startup failure leaves the terminal clean. - After the run completes, the persona calls
TuiObserver::shutdownto wait on the TUI thread, thenprint_post_run_summaryfor the post-teardown summary line + tree, then exits with an appropriate status fromunreached_phase_exit_code.
Structs§
- TuiObserver
RunObserverimpl that drivescrate::app::Appfrom runner lifecycle events.
Functions§
- print_
post_ run_ summary - Print a summary of the run after the TUI has torn down.
- unreached_
phase_ exit_ code - Returns
Some(2)if any phases were pre-mapped (reachable via scenario traversal) but never reachedRunningstatus — the caller should print a warning and exit with this code. ReturnsNoneif every reachable phase was visited.