pub struct Live { /* private fields */ }Expand description
Manages a live-updating region of the terminal.
Implementations§
Source§impl Live
impl Live
Sourcepub fn new(renderable: impl Renderable + Send + Sync + 'static) -> Self
pub fn new(renderable: impl Renderable + Send + Sync + 'static) -> Self
Create a new Live display wrapping the given Renderable.
Sourcepub fn no_auto_refresh(self) -> Self
pub fn no_auto_refresh(self) -> Self
Builder: disable automatic periodic refresh.
Sourcepub fn refresh_per_second(self, rate: f64) -> Self
pub fn refresh_per_second(self, rate: f64) -> Self
Builder: set the refresh rate in Hz (default 4.0).
Sourcepub fn transient(self) -> Self
pub fn transient(self) -> Self
Builder: enable transient mode (live display disappears on stop).
Sourcepub fn redirect_stdout(self, redirect: bool) -> Self
pub fn redirect_stdout(self, redirect: bool) -> Self
Builder: redirect stdout writes into the live display.
Sourcepub fn redirect_stderr(self, redirect: bool) -> Self
pub fn redirect_stderr(self, redirect: bool) -> Self
Builder: redirect stderr writes into the live display.
Sourcepub fn add_writer(&mut self, writer: LiveWriter)
pub fn add_writer(&mut self, writer: LiveWriter)
Register a writer whose captured content will be rendered during refresh.
Sourcepub fn create_writer() -> LiveWriter ⓘ
pub fn create_writer() -> LiveWriter ⓘ
Create a LiveWriter that captures output while Live is active.
Sourcepub fn start(&mut self) -> Result<()>
pub fn start(&mut self) -> Result<()>
Start the live display: enter alternate screen (if configured) and hide cursor.
Sourcepub fn stop(&mut self) -> Result<()>
pub fn stop(&mut self) -> Result<()>
Stop the live display: restore cursor, exit alternate screen, and clean up.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Live
impl !RefUnwindSafe for Live
impl Send for Live
impl Sync for Live
impl Unpin for Live
impl UnsafeUnpin for Live
impl !UnwindSafe for Live
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