#[non_exhaustive]pub enum PtySignal {
Interrupt,
Quit,
Terminate,
Kill,
Hangup,
WindowChange,
Stop,
Continue,
User1,
User2,
}Expand description
Cross-platform signal representation.
This enum provides a unified interface for signals across Unix and Windows. On Windows, signals are emulated using console events or process control.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Interrupt
Interrupt signal (Ctrl+C).
- Unix: SIGINT (2)
- Windows:
CTRL_C_EVENT
Quit
Quit signal (Ctrl+).
- Unix: SIGQUIT (3)
- Windows: Not directly supported
Terminate
Terminate signal.
- Unix: SIGTERM (15)
- Windows:
TerminateProcess
Kill
Kill signal (cannot be caught).
- Unix: SIGKILL (9)
- Windows:
TerminateProcess
Hangup
Hangup signal (terminal closed).
- Unix: SIGHUP (1)
- Windows:
CTRL_CLOSE_EVENT
WindowChange
Window size change.
- Unix: SIGWINCH (28)
- Windows: Handled via
ConPTYresize
Stop
Stop signal (Ctrl+Z).
- Unix: SIGTSTP (20)
- Windows: Not supported
Continue
Continue signal.
- Unix: SIGCONT (18)
- Windows: Not supported
User1
User-defined signal 1.
- Unix: SIGUSR1 (10)
- Windows: Not supported
User2
User-defined signal 2.
- Unix: SIGUSR2 (12)
- Windows: Not supported
Implementations§
Trait Implementations§
impl Copy for PtySignal
impl Eq for PtySignal
impl StructuralPartialEq for PtySignal
Auto Trait Implementations§
impl Freeze for PtySignal
impl RefUnwindSafe for PtySignal
impl Send for PtySignal
impl Sync for PtySignal
impl Unpin for PtySignal
impl UnwindSafe for PtySignal
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