#[non_exhaustive]pub enum UnixGracefulSignal {
Interrupt,
Terminate,
}Expand description
Graceful-shutdown signal that can be the first or escalation step on Unix before the implicit SIGKILL fallback.
Marked #[non_exhaustive] so additional Unix signals (e.g. SIGHUP, SIGUSR1) can be added
in future minor releases without forcing a breaking change on match users.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Interrupt
SIGINT. Default disposition is Term (kernel terminates the process when no handler is
installed). Idiomatic Tokio applications using tokio::signal::ctrl_c() install a SIGINT
handler, but service-style children (systemd, K8s, Docker) typically install only a
SIGTERM handler, in which case the kernel default disposition kills the child without
running the user’s shutdown logic.
Terminate
SIGTERM. Default disposition is Term (kernel terminates the process when no handler is
installed). The conventional “please shut down” signal in Unix; what kill <pid> (no args)
sends and what systemd, K8s, Docker, runit, and supervisord all use.
Trait Implementations§
Source§impl Clone for UnixGracefulSignal
impl Clone for UnixGracefulSignal
Source§fn clone(&self) -> UnixGracefulSignal
fn clone(&self) -> UnixGracefulSignal
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 UnixGracefulSignal
impl Debug for UnixGracefulSignal
Source§impl PartialEq for UnixGracefulSignal
impl PartialEq for UnixGracefulSignal
Source§fn eq(&self, other: &UnixGracefulSignal) -> bool
fn eq(&self, other: &UnixGracefulSignal) -> bool
self and other values to be equal, and is used by ==.