pub enum Method {
CtrlC,
CtrlBreak,
CloseWindow,
}Expand description
A cross-platform way to ask a process to stop.
POSIX has no equivalent of the Windows console control events or window
messages, so there every method sends SIGINT.
Variants§
CtrlC
Windows: CTRL_C_EVENT to the target console. POSIX: SIGINT.
Reaches every process attached to that console which has not disabled Ctrl+C handling.
CtrlBreak
Windows: CTRL_BREAK_EVENT to the target console. POSIX: SIGINT.
Unlike Ctrl+C it cannot be disabled with SetConsoleCtrlHandler(NULL, TRUE), so it is more reliable for processes that masked Ctrl+C.
CloseWindow
Windows: posts WM_CLOSE to the main GUI window of the process; for a packaged (UWP)
app, to the frame window that hosts it. POSIX: SIGINT.
Trait Implementations§
impl Copy for Method
impl Eq for Method
impl StructuralPartialEq for Method
Auto Trait Implementations§
impl Forget for Method
impl Freeze for Method
impl Move for Method
impl RefUnwindSafe for Method
impl Send for Method
impl Sync for Method
impl Unpin for Method
impl UnsafeUnpin for Method
impl UnwindSafe for Method
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