pub struct Renderer { /* private fields */ }Expand description
Renders cell changes into ANSI escape sequences.
Implementations§
Source§impl Renderer
impl Renderer
Sourcepub fn new(color_support: ColorSupport, synchronized_output: bool) -> Self
pub fn new(color_support: ColorSupport, synchronized_output: bool) -> Self
Create a new renderer with the given color support level.
Sourcepub fn render(&self, changes: &[CellChange]) -> String
pub fn render(&self, changes: &[CellChange]) -> String
Render a set of cell changes into a string of ANSI escape sequences.
Sourcepub fn render_batched(&self, changes: &[CellChange]) -> String
pub fn render_batched(&self, changes: &[CellChange]) -> String
Render cell changes using batched output for fewer escape sequences.
Groups consecutive same-row cells into DeltaBatches, then renders
each batch with a single cursor-move and minimal style transitions.
This can produce shorter output than render when
many adjacent cells change.
Sourcepub fn render_optimized(&self, changes: &[CellChange]) -> String
pub fn render_optimized(&self, changes: &[CellChange]) -> String
Render cell changes with cursor hidden and combined SGR sequences.
This variant wraps the output with cursor-hide (\x1b[?25l) at the
start and cursor-show (\x1b[?25h) at the end, which prevents cursor
flicker during rendering. Style attributes are emitted as combined SGR
sequences (e.g. \x1b[1;3;31m instead of separate codes).