pub struct TerminalRawGuard { /* private fields */ }Expand description
RAII terminal raw-mode, alternate-screen, mouse, and cursor restoration guard surviving normal and panic exits.
Implementations§
Source§impl TerminalRawGuard
RAII terminal mode entry and idempotent restoration methods for TerminalRawGuard.
impl TerminalRawGuard
RAII terminal mode entry and idempotent restoration methods for TerminalRawGuard.
Sourcepub fn enter_live(
alt_screen: bool,
mouse_enabled: bool,
paste_enabled: bool,
cursor_hidden: bool,
) -> Self
pub fn enter_live( alt_screen: bool, mouse_enabled: bool, paste_enabled: bool, cursor_hidden: bool, ) -> Self
Enters live OS terminal raw mode (Unix termios / Windows VT console), installs SIGWINCH, and emits enter sequences.
§Arguments
bool- Enter alternate screen buffer.bool- Enable SGR 1006 mouse tracking.bool- Enable bracketed paste mode.bool- Hide terminal cursor.
§Returns
Self- Active RAII guard restoring terminal state on drop.
Sourcepub fn enter_captured(
alt_screen: bool,
mouse_enabled: bool,
paste_enabled: bool,
cursor_hidden: bool,
sink: Option<Rc<RefCell<String>>>,
) -> Self
pub fn enter_captured( alt_screen: bool, mouse_enabled: bool, paste_enabled: bool, cursor_hidden: bool, sink: Option<Rc<RefCell<String>>>, ) -> Self
Creates a deterministic captured RAII guard writing enter/restore sequences into sink without mutating host TTY state.
§Arguments
bool- Emit alternate screen enter/leave sequences.bool- Emit mouse enable/disable sequences.bool- Emit bracketed paste enable/disable sequences.bool- Emit cursor hide/show sequences.Option<Rc<RefCell<String>>>- Optional capture sink recording emitted ANSI sequences.
§Returns
Self- Captured RAII terminal guard.
Source§impl TerminalRawGuard
impl TerminalRawGuard
pub fn get_os_raw_active(&self) -> bool
pub fn get_mut_os_raw_active(&mut self) -> &mut bool
pub fn set_os_raw_active(&mut self, val: bool) -> &mut Self
pub fn get_alt_screen(&self) -> bool
pub fn get_mut_alt_screen(&mut self) -> &mut bool
pub fn set_alt_screen(&mut self, val: bool) -> &mut Self
pub fn get_mouse_enabled(&self) -> bool
pub fn get_mut_mouse_enabled(&mut self) -> &mut bool
pub fn set_mouse_enabled(&mut self, val: bool) -> &mut Self
pub fn get_paste_enabled(&self) -> bool
pub fn get_mut_paste_enabled(&mut self) -> &mut bool
pub fn set_paste_enabled(&mut self, val: bool) -> &mut Self
pub fn get_restored(&self) -> bool
pub fn get_mut_restored(&mut self) -> &mut bool
pub fn set_restored(&mut self, val: bool) -> &mut Self
pub fn get_write_to_stdout(&self) -> bool
pub fn get_mut_write_to_stdout(&mut self) -> &mut bool
pub fn set_write_to_stdout(&mut self, val: bool) -> &mut Self
Trait Implementations§
Source§impl Debug for TerminalRawGuard
impl Debug for TerminalRawGuard
Auto Trait Implementations§
impl !RefUnwindSafe for TerminalRawGuard
impl !Send for TerminalRawGuard
impl !Sync for TerminalRawGuard
impl !UnwindSafe for TerminalRawGuard
impl Forget for TerminalRawGuard
impl Freeze for TerminalRawGuard
impl Move for TerminalRawGuard
impl Unpin for TerminalRawGuard
impl UnsafeUnpin for TerminalRawGuardwhere
*const RcInner<RefCell<String>> is !null: UnsafeUnpin,
PhantomData<RcInner<RefCell<String>>>: UnsafeUnpin,
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