pub struct TerminalSession<'a, C: RawModeControl + CommandWriter + KeyboardEnhancementQuery + ?Sized> { /* private fields */ }Expand description
A guard for every terminal state successfully acquired during entry.
Call restore on normal and error returns so restoration
errors can be reported. Drop is the final guard during panic unwinding.
It cannot report restoration failures. The session cannot restore the
cursor’s pre-entry position, process aborts, kill -9, or signals whose
handling never unwinds through this value.
Implementations§
Source§impl<'a, C> TerminalSession<'a, C>
impl<'a, C> TerminalSession<'a, C>
Sourcepub fn enter(
control: &'a mut C,
options: SessionOptions,
) -> Result<Self, SessionError>
pub fn enter( control: &'a mut C, options: SessionOptions, ) -> Result<Self, SessionError>
Acquires the requested modes, restoring partial state if entry fails.
Sourcepub fn control_mut(&mut self) -> &mut C
pub fn control_mut(&mut self) -> &mut C
Borrows the underlying control while the session remains active.
Trait Implementations§
Source§impl<C> Drop for TerminalSession<'_, C>
impl<C> Drop for TerminalSession<'_, C>
Auto Trait Implementations§
impl<'a, C> Freeze for TerminalSession<'a, C>where
C: ?Sized,
impl<'a, C> RefUnwindSafe for TerminalSession<'a, C>where
C: RefUnwindSafe + ?Sized,
impl<'a, C> Send for TerminalSession<'a, C>
impl<'a, C> Sync for TerminalSession<'a, C>
impl<'a, C> Unpin for TerminalSession<'a, C>where
C: ?Sized,
impl<'a, C> UnsafeUnpin for TerminalSession<'a, C>where
C: ?Sized,
impl<'a, C> !UnwindSafe for TerminalSession<'a, C>
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