pub struct LiveConfig {
pub rows: usize,
pub cols: usize,
pub scrollback: usize,
}Expand description
How the live console lays out and truncates tiles.
The console does not auto-detect the terminal width or react to resizes:
cols is a fixed tile width the caller supplies once.
Passing a value that does not match the real terminal only over- or under-truncates the tiles;
it never corrupts output, since every tile line is clamped to cols.
Fields§
§rows: usizeMaximum content rows a region tile may occupy — the height of its virtual terminal
and the cap a tile grows to. A tile does not reserve this height: it starts at just its header
and grows with its content up to this many rows (see LiveConsole::feed), so a silent
or short-lived region stays small instead of padding out a tall empty block.
cols: usizeTerminal columns: the tile width.
A child’s output is applied to a grid sized to the visible content area (this width minus the content indent),
so a real width must be passed (unlike the old truncation width, 0 is not “disable”).
scrollback: usizeHow many rows that scroll off a tile are retained per region for a failure replay.
The live tile stays a bounded peek;
on failure this many of the most-recent scrolled-off rows (plus the final on-screen rows) are flushed to scrollback as the failure block.
0 retains nothing, so a failure replays only the rows still on screen.
Implementations§
Source§impl LiveConfig
impl LiveConfig
Sourcepub fn content_cols(&self) -> usize
pub fn content_cols(&self) -> usize
The inner virtual-terminal grid width: the tile width minus the content indent rendered under each region header.
A child whose output is fed to the tile must be told its terminal is this wide (not the full tile width), so its own line wrapping matches the grid. Otherwise a full-width in-place progress redraw wraps at the grid edge, scrolls the short grid, and churns the retained failure tail with stale half-frames on every tick — which then surface in the bounded replay when a region fails.
Trait Implementations§
Source§impl Clone for LiveConfig
impl Clone for LiveConfig
Source§fn clone(&self) -> LiveConfig
fn clone(&self) -> LiveConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more