pub struct App {
pub should_quit: bool,
pub should_exit_process: bool,
pub yielded_to_terminal: bool,
pub external_quit: Arc<AtomicBool>,
pub tick_rate: Duration,
pub show_log: bool,
pub log_level_filter: LogSeverity,
/* private fields */
}Expand description
TUI application.
Fields§
§should_quit: bool§should_exit_process: boolIf true, the entire nmbrs process should exit after the TUI
cleans up its terminal state. Set by triple-tapping q.
yielded_to_terminal: boolSet when the user pressed Ctrl-T inside the TUI to hand
the terminal back to line-mode (tui=terminal) display.
The sink supervisor reads this on the App thread’s join
to decide whether to bring LogOnlySink back up
(true — toggle) or treat the run as fully complete
(false — natural exit / Ctrl-C / triple-q). Public so
the supervisor can read after App::run() returns.
external_quit: Arc<AtomicBool>External-quit hook the sink supervisor sets when it wants
to pull the TUI down without a user keystroke (e.g. the
run completed and the supervisor is shutting down all
sinks). The event loop polls this each iteration alongside
the existing should_quit flag.
tick_rate: Duration§show_log: boolWhether the log panel is visible (toggled with l key).
log_level_filter: LogSeverityMinimum severity rendered in the log panel. Defaults to
Info so high-cadence Debug instrumentation
(per-fiber-exit, cadence-ingest tracing) doesn’t drown
the signal. Cycled by the D key:
Info → Debug → Warn → Error → Info.
Implementations§
Source§impl App
impl App
Sourcepub fn new(
frame_rx: Receiver<MetricSet>,
run_state: RunStateHandle,
metrics_query: Arc<MetricsQuery>,
) -> Self
pub fn new( frame_rx: Receiver<MetricSet>, run_state: RunStateHandle, metrics_query: Arc<MetricsQuery>, ) -> Self
Create with a metrics channel and a RunStateHandle
(snapshot reader + command sender — see SRD-02 §“Display
and Diagnostic Decoupling”).
Sourcepub fn edit_prompt(&self) -> Option<&ControlEditPrompt>
pub fn edit_prompt(&self) -> Option<&ControlEditPrompt>
Borrow the current control-edit prompt (if visible). Widgets use this to render the inline prompt bar.
Sourcepub fn is_editing(&self) -> bool
pub fn is_editing(&self) -> bool
Whether the TUI is currently in edit mode. Event loops in edit mode route character input to the prompt buffer instead of navigation.
Sourcepub fn open_control_edit_prompt(&mut self)
pub fn open_control_edit_prompt(&mut self)
Open the inline control-edit prompt. The prompt accepts
name=value text; submit via Self::submit_control_edit.
Sourcepub fn close_control_edit_prompt(&mut self)
pub fn close_control_edit_prompt(&mut self)
Close the prompt without submitting.
Sourcepub fn edit_push_char(&mut self, c: char)
pub fn edit_push_char(&mut self, c: char)
Append a character to the edit buffer. No-op when not in edit mode.
Sourcepub fn edit_pop_char(&mut self)
pub fn edit_pop_char(&mut self)
Remove the last character from the edit buffer.
Sourcepub fn submit_control_edit(&mut self) -> Option<(String, f64)>
pub fn submit_control_edit(&mut self) -> Option<(String, f64)>
Submit the current edit buffer. Parses name=value,
dispatches a non-blocking set_f64 against the named
control through the session-root globals installed by
the runner. Records the outcome on the prompt for
inline display.
Returns the parsed (name, value) on successful
dispatch so tests can assert.
Sourcepub fn set_tree_lod_label(&mut self, label: &str)
pub fn set_tree_lod_label(&mut self, label: &str)
Set the tree LOD directly. Production code changes LOD
through left/right arrow keybinds via Self::adjust_tree_lod;
tests use this helper to render a specific view without
routing a synthetic key event.
Accepted labels match [TreeLod::label]: "off",
"phase", "min", "focus", "def", "max". Unknown
labels leave the current LOD unchanged.
Sourcepub fn run(&mut self) -> Result<()>
pub fn run(&mut self) -> Result<()>
Run the TUI event loop. Blocks until quit or run completes.
Terminal cleanup is guaranteed across every exit path —
normal return, propagated ? error, and panic — via a
[TerminalGuard] (Drop-based) and a panic hook installed
for the duration of the run. Either mechanism restores raw
mode, leaves the alternate screen, and disables mouse
capture before control returns to the shell.
The event loop also intercepts Ctrl+C as a distinct
signal from q. Ctrl+C tears the TUI down and then raises
SIGINT to the current process so the signal propagates
through any runtime handlers the rest of the process has
installed (tokio ctrl_c, shell-level exit codes, etc.)
with standard interrupt semantics.
Sourcepub fn draw(&self, frame: &mut Frame<'_>)
pub fn draw(&self, frame: &mut Frame<'_>)
Render one frame. Public for testing with TestBackend.
While paused, every read routes through the snapshot clone
in self.frozen_state instead of the live state. Live
observer updates keep flowing into self.run_state — they
just don’t affect the rendered frame until the user resumes.
Sourcepub fn cycle_readout_focus_next(&mut self)
pub fn cycle_readout_focus_next(&mut self)
Cycle focus forward through the readouts bound to
the most-recently-fired event slot. Public for the
Tab keybind. No-op when the binder hasn’t fired
yet (no slot context).
Sourcepub fn cycle_readout_focus_prev(&mut self)
pub fn cycle_readout_focus_prev(&mut self)
Cycle focus backward through the most-recent slot’s readouts. Bound to Shift-Tab.
Sourcepub fn cycle_readout_lod_up(&mut self)
pub fn cycle_readout_lod_up(&mut self)
Cycle the focused readout’s LOD up
(compact → labeled → expanded → compact). Bound to
+. No-op when no readout is focused.
Sourcepub fn cycle_readout_lod_down(&mut self)
pub fn cycle_readout_lod_down(&mut self)
Cycle the focused readout’s LOD down. Bound to -.
Sourcepub fn toggle_readout_overlay(&mut self)
pub fn toggle_readout_overlay(&mut self)
Toggle the explanation-overlay flag. While set, every
readout fire emits ContentMode::Explanation instead
of Value. Bound to \. The held-key semantics from
SRD-63 are approximated as a press-toggle because
crossterm’s standard polling doesn’t surface key-
release reliably.
Sourcepub fn readout_overlay_active(&self) -> bool
pub fn readout_overlay_active(&self) -> bool
Whether the explanation overlay is currently active.
Surface code (footer, panel render path) reads this
to render an indicator and to pass the right
ContentMode when firing the binder.
Auto Trait Implementations§
impl !Freeze for App
impl !RefUnwindSafe for App
impl !Sync for App
impl !UnwindSafe for App
impl Forget for App
impl Move for App
impl Send for App
impl Unpin for App
impl UnsafeUnpin for App
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more