pub struct UnixConsoleControl;Implementations§
Trait Implementations§
Source§impl Clone for UnixConsoleControl
impl Clone for UnixConsoleControl
Source§fn clone(&self) -> UnixConsoleControl
fn clone(&self) -> UnixConsoleControl
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ConsoleControl for UnixConsoleControl
impl ConsoleControl for UnixConsoleControl
const HANDLER_CONTRACT: HandlerContract = HandlerContract::AsyncSignalSafe
Source§type Saved = UnixModes
type Saved = UnixModes
The saved modes, held by the caller — which is what lets the caller
keep them in a
OnceLock rather than a leaked AtomicPtr.Source§fn capture(&self) -> Result<Self::Saved>
fn capture(&self) -> Result<Self::Saved>
Capture the modes as they are now. Call before anything enters raw
mode: a later call would save raw modes as the thing to restore to.
Source§fn restore(&self, saved: &Self::Saved) -> Result<()>
fn restore(&self, saved: &Self::Saved) -> Result<()>
Put the modes back. Must be callable from the interrupt handler, so on
Unix this is
tcsetattr and nothing else.Source§fn write_raw(&self, bytes: &[u8])
fn write_raw(&self, bytes: &[u8])
Write bytes straight to the terminal, bypassing any buffering — the
escape-sequence half of a restore. Async-signal-safe on Unix.
Source§fn trap(&self, on_interrupt: fn()) -> Result<()>
fn trap(&self, on_interrupt: fn()) -> Result<()>
Run
on_interrupt for each interrupt-class event, then exit. Read moreSource§fn interrupt_exit_code(&self) -> i32
fn interrupt_exit_code(&self) -> i32
The process exit code for “killed by an interrupt”. Read more
impl Copy for UnixConsoleControl
Source§impl Debug for UnixConsoleControl
impl Debug for UnixConsoleControl
Source§impl Default for UnixConsoleControl
impl Default for UnixConsoleControl
Source§fn default() -> UnixConsoleControl
fn default() -> UnixConsoleControl
Returns the “default value” for a type. Read more
impl Sealed for UnixConsoleControl
Auto Trait Implementations§
impl Freeze for UnixConsoleControl
impl RefUnwindSafe for UnixConsoleControl
impl Send for UnixConsoleControl
impl Sync for UnixConsoleControl
impl Unpin for UnixConsoleControl
impl UnsafeUnpin for UnixConsoleControl
impl UnwindSafe for UnixConsoleControl
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