pub struct TerminalSessionGuard { /* private fields */ }Expand description
RAII terminal session guard restoring cursor visibility, raw mode flags, and alternate screen on drop.
Implementations§
Source§impl TerminalSessionGuard
Session lifecycle entry and idempotent ANSI state restoration for TerminalSessionGuard.
impl TerminalSessionGuard
Session lifecycle entry and idempotent ANSI state restoration for TerminalSessionGuard.
Sourcepub fn build_enter_sequence(
alt_screen: bool,
cursor_hidden: bool,
raw_mode: bool,
) -> String
pub fn build_enter_sequence( alt_screen: bool, cursor_hidden: bool, raw_mode: bool, ) -> String
Sourcepub fn build_restore_sequence(
alt_screen: bool,
cursor_hidden: bool,
raw_mode: bool,
) -> String
pub fn build_restore_sequence( alt_screen: bool, cursor_hidden: bool, raw_mode: bool, ) -> String
Sourcepub fn enter_captured(
alt_screen: bool,
cursor_hidden: bool,
raw_mode: bool,
sink: Option<Rc<RefCell<String>>>,
) -> Self
pub fn enter_captured( alt_screen: bool, cursor_hidden: bool, raw_mode: bool, sink: Option<Rc<RefCell<String>>>, ) -> Self
Enters an interactive terminal session writing enter/restore sequences to an optional capture buffer.
§Arguments
bool- Enter alternate screen buffer.bool- Hide terminal cursor.bool- Enable raw input tracking modes.Option<Rc<RefCell<String>>>- Optional capture buffer for deterministic testing or virtual PTYs.
§Returns
Self- Active RAII session guard.
Sourcepub fn enter_stdout(
alt_screen: bool,
cursor_hidden: bool,
raw_mode: bool,
) -> Self
pub fn enter_stdout( alt_screen: bool, cursor_hidden: bool, raw_mode: bool, ) -> Self
Sourcepub fn restore_now(&mut self) -> String
pub fn restore_now(&mut self) -> String
Source§impl TerminalSessionGuard
impl TerminalSessionGuard
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_raw_mode(&self) -> bool
pub fn get_mut_raw_mode(&mut self) -> &mut bool
pub fn set_raw_mode(&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 TerminalSessionGuard
impl Debug for TerminalSessionGuard
Auto Trait Implementations§
impl !RefUnwindSafe for TerminalSessionGuard
impl !Send for TerminalSessionGuard
impl !Sync for TerminalSessionGuard
impl !UnwindSafe for TerminalSessionGuard
impl Forget for TerminalSessionGuard
impl Freeze for TerminalSessionGuard
impl Move for TerminalSessionGuard
impl Unpin for TerminalSessionGuard
impl UnsafeUnpin for TerminalSessionGuard
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