pub struct Display { /* private fields */ }Expand description
In-place terminal renderer.
Uses absolute cursor positioning (origin_row) so that interleaved
stderr output (e.g. from eprintln!) cannot corrupt the display area.
Implementations§
Source§impl Display
impl Display
pub fn new() -> Self
Sourcepub fn update(&mut self, state: RecordingState, meta: &DisplayMeta<'_>)
pub fn update(&mut self, state: RecordingState, meta: &DisplayMeta<'_>)
Erases previously rendered lines and renders the new state in place.
Uses only relative cursor movement (MoveUp) so it works with or
without raw mode and is immune to cursor::position() hangs.
The cursor is left at the end of the last rendered line (no trailing
newline) so that the next update can move back up exactly
line_count - 1 lines to reach the first rendered line.
Sourcepub fn log(&mut self, msg: &str)
pub fn log(&mut self, msg: &str)
Prints a log message above the display area.
Clears the current display, writes msg to stdout on its own line,
then resets line_count so the next update() renders cleanly below.
All output goes through stdout to avoid cursor-tracking issues with
stderr interleaving.