pub struct RawModeGuard { /* private fields */ }Expand description
RAII guard that saves the original termios and restores it on drop.
This is the foundation for panic-safe terminal cleanup: even if the
application panics, the Drop impl runs (unless panic = "abort") and
the terminal returns to its original state.
The guard opens /dev/tty to get an owned fd that is valid for the
lifetime of the guard, avoiding unsafe BorrowedFd construction.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RawModeGuard
impl !RefUnwindSafe for RawModeGuard
impl Send for RawModeGuard
impl !Sync for RawModeGuard
impl Unpin for RawModeGuard
impl UnwindSafe for RawModeGuard
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