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 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 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
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
The
(minimum, maximum) cell width this renderable wants. The default
assumes the renderable fills the available width (e.g. Panel, Table);
Text overrides it with its content width so the top-level print path can
shrink to fit. Port of __rich_measure__ / Measurement.get.Source§fn fit_to_measurement(&self) -> bool
fn fit_to_measurement(&self) -> bool
Whether a top-level
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.Auto Trait Implementations§
impl !Freeze for LiveRender
impl !RefUnwindSafe for LiveRender
impl !Send for LiveRender
impl !Sync for LiveRender
impl !UnwindSafe for LiveRender
impl Unpin for LiveRender
impl UnsafeUnpin for LiveRender
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
Mutably borrows from an owned value. Read more