pub struct Output { /* private fields */ }
Expand description
Implementations§
source§impl Output
impl Output
sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Creates a new Output
instance containing a
ScreenGuard
instance.
Errors
Error::WriteStdout
: failed to write initialization to stdout
sourcepub fn new_without_screen() -> Self
pub fn new_without_screen() -> Self
Creates a new Output
instance without creating a
ScreenGuard
instance.
sourcepub fn take_screen_guard(&mut self) -> Option<ScreenGuard>
pub fn take_screen_guard(&mut self) -> Option<ScreenGuard>
Removes the ScreenGuard
instance stored in this
Output
instance and returns it. This can be useful if you need to
manage the lifetime of the ScreenGuard
instance
separately.
sourcepub fn refresh(&mut self) -> Result<()>
pub fn refresh(&mut self) -> Result<()>
Draws the in-memory screen to the terminal on stdout
. This is done
using a diff mechanism to only update the parts of the terminal which
are different from the in-memory screen.
Errors
Error::WriteStdout
: failed to write screen state to stdout
sourcepub fn hard_refresh(&mut self) -> Result<()>
pub fn hard_refresh(&mut self) -> Result<()>
Draws the in-memory screen to the terminal on stdout
. This clears
the screen and redraws it from scratch, rather than using a diff
mechanism like refresh
. This can be useful when the current state of
the terminal screen is unknown, such as after the terminal has been
resized.
Errors
Error::WriteStdout
: failed to write screen state to stdout
Trait Implementations§
source§impl Textmode for Output
impl Textmode for Output
source§fn screen(&self) -> &Screen
fn screen(&self) -> &Screen
refresh
.