pub struct LiveRender { /* private fields */ }Expand description
Wraps a renderable for repeated in-place redraws. Mirrors
rich.live_render.LiveRender.
Implementations§
Source§impl LiveRender
impl LiveRender
pub fn new(renderable: Box<dyn Renderable>) -> Self
Sourcepub fn vertical_overflow(self, vertical_overflow: VerticalOverflow) -> Self
pub fn vertical_overflow(self, vertical_overflow: VerticalOverflow) -> Self
What to do with content taller than the screen (upstream
vertical_overflow, default VerticalOverflow::Ellipsis).
Sourcepub fn set_vertical_overflow(&mut self, vertical_overflow: VerticalOverflow)
pub fn set_vertical_overflow(&mut self, vertical_overflow: VerticalOverflow)
Set vertical_overflow in place.
Sourcepub fn set_renderable(&mut self, renderable: Box<dyn Renderable>)
pub fn set_renderable(&mut self, renderable: Box<dyn Renderable>)
Replace the wrapped renderable (the shape carries over until the next
render). Port of LiveRender.set_renderable.
Sourcepub fn renderable(&self) -> &dyn Renderable
pub fn renderable(&self) -> &dyn Renderable
The wrapped renderable. Upstream’s LiveRender.renderable.
Sourcepub fn last_render_height(&self) -> usize
pub fn last_render_height(&self) -> usize
The height of the last render, 0 before any. Port of
LiveRender.last_render_height.
Sourcepub fn position_cursor(&self) -> Control
pub fn position_cursor(&self) -> Control
Control codes to move the cursor to the start of the previous render,
erasing each line. Port of LiveRender.position_cursor.
Sourcepub fn restore_cursor(&self) -> Control
pub fn restore_cursor(&self) -> Control
Control codes to clear the render and restore the cursor to where it was
before it. Port of LiveRender.restore_cursor.
Trait Implementations§
Source§impl Renderable for LiveRender
impl Renderable for LiveRender
Source§fn print_end_line(&self, _options: &ConsoleOptions) -> bool
fn print_end_line(&self, _options: &ConsoleOptions) -> bool
Upstream yields no line break after the last line, so a printed
LiveRender leaves the cursor at its end (where position_cursor
expects it).
fn rich_render( &self, console: &Console, options: &ConsoleOptions, ) -> Vec<Segment>
Source§fn measure(&self, _console: &Console, options: &ConsoleOptions) -> Measurement
fn measure(&self, _console: &Console, options: &ConsoleOptions) -> Measurement
(minimum, maximum) cell width this renderable wants. Port of
__rich_measure__. The default is what upstream’s Measurement.get
returns for a renderable without one: anything from nothing to the
whole width, (0, max_width).Source§fn fit_to_measurement(&self) -> bool
fn fit_to_measurement(&self) -> bool
Console::print shrinks this renderable to its
measured width. Upstream renders every top-level renderable at the full
console width, so the default is false; an extension may opt in.