pub enum CancellationSignal {
Interrupt,
Terminate,
}Expand description
The OS signal that initiated a run-cancellation request, per
EXEC-012.
Captured by the consuming binary’s signal handler and passed
to exit_code_for so the resulting exit code reflects POSIX
convention (128 + signal_number, per EXEC-021).
This type is intentionally distinct from
crate::process::Signal (which is the EXECUTOR-to-child
signal vocabulary and includes Kill). CancellationSignal
is INCOMING from the OS to the haz binary; only SIGINT and
SIGTERM are user-installable cancellation sources
(SIGKILL is uncatchable).
Variants§
Interrupt
SIGINT, the interactive interrupt (typically Ctrl+C in
a foreground shell). POSIX signal number 2.
Terminate
SIGTERM, the polite-termination signal. POSIX signal
number 15.
Implementations§
Source§impl CancellationSignal
impl CancellationSignal
Sourcepub const fn posix_number(self) -> i32
pub const fn posix_number(self) -> i32
POSIX signal number for this cancellation signal.
Returns 2 for Self::Interrupt and 15 for
Self::Terminate.
Trait Implementations§
Source§impl Clone for CancellationSignal
impl Clone for CancellationSignal
Source§fn clone(&self) -> CancellationSignal
fn clone(&self) -> CancellationSignal
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CancellationSignal
impl Debug for CancellationSignal
Source§impl Hash for CancellationSignal
impl Hash for CancellationSignal
Source§impl PartialEq for CancellationSignal
impl PartialEq for CancellationSignal
Source§fn eq(&self, other: &CancellationSignal) -> bool
fn eq(&self, other: &CancellationSignal) -> bool
self and other values to be equal, and is used by ==.