pub struct Tui { /* private fields */ }Expand description
An owned terminal in raw mode + alternate screen, restored on drop.
Implementations§
Source§impl Tui
impl Tui
Sourcepub fn enter(mouse: bool) -> Result<Tui>
pub fn enter(mouse: bool) -> Result<Tui>
Enters raw mode and the alternate screen (with mouse capture if enabled).
Errors (without touching the terminal) when stderr is not a real
terminal. The TUI draws to stderr, and enable_raw_mode performs a
tcsetattr on the controlling terminal — so taking it over is only safe
when stderr is genuinely a terminal. Enforcing that precondition here,
at the irreversible boundary, rather than relying solely on the
higher-level crate::cx::Cx TTY gate, keeps any non-TTY run (tests,
pipes, or a cargo mutants child in a background process group) from
being stopped by SIGTTOU and wedging indefinitely.
Sourcepub fn suspend(&mut self) -> Result<()>
pub fn suspend(&mut self) -> Result<()>
Leaves raw mode / alt screen to run a foreground program (e.g. editor).
Sourcepub fn resume(&mut self) -> Result<()>
pub fn resume(&mut self) -> Result<()>
Re-enters raw mode / alt screen after Tui::suspend.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tui
impl RefUnwindSafe for Tui
impl Send for Tui
impl Sync for Tui
impl Unpin for Tui
impl UnsafeUnpin for Tui
impl UnwindSafe for Tui
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more