pub enum OperatorSignal {
Hup,
Int,
Quit,
Term,
Usr1,
Usr2,
Winch,
Cont,
Kill,
}Expand description
A signal shep signal may name.
Nine, not every signal on the platform. Each one here is something an
operator plausibly means to say to an application, and nothing here is a
signal shep would be delivering on the kernel’s behalf (SIGSEGV,
SIGBUS, SIGPIPE and the rest are the kernel’s to send, not an
operator’s).
Exhaustive, not #[non_exhaustive], matching
KillSignal and for the same reason (IR-20:
don’t cargo-cult it). Growth is possible but is not anticipated, and a
caller matching on all nine — shep-daemon’s own mapping to nix is the one
that matters — should get a compile error the day a tenth arrives rather
than a silent wildcard arm.
Variants§
Hup
SIGHUP — hang up. The near-universal “re-read your configuration”.
Int
SIGINT — interrupt, what Ctrl-C sends.
Quit
SIGQUIT — quit, core-dumping by default. Several runtimes dump every
thread’s stack on it instead.
Term
SIGTERM — the polite stop. Sending it here bypasses the stop ladder
entirely: shep does not start a kill_timeout, does not escalate, and
does not mark the sheep stopped. Use shep stop for a stop.
Usr1
SIGUSR1 — user-defined signal 1.
Usr2
SIGUSR2 — user-defined signal 2, the one several runtimes reserve for
a graceful restart.
Winch
SIGWINCH — terminal resized. Harmless to nearly everything, which is
what makes it the signal to test a wiring with.
Cont
SIGCONT — continue a stopped process.
Kill
SIGKILL — unblockable, immediate. The restart policy will see the
exit as any other unexpected one and act on it: an app with
autorestart on comes back.
Implementations§
Source§impl OperatorSignal
impl OperatorSignal
Sourcepub const ACCEPTED: [&'static str; 9]
pub const ACCEPTED: [&'static str; 9]
Every spelling this grammar accepts, canonical form, in the order a refusal lists them.
Public because it is rendered into the refusal an operator reads and
into shep signal --help; a second hand-written list in either place
is one free to drift.
Trait Implementations§
Source§impl Clone for OperatorSignal
impl Clone for OperatorSignal
Source§fn clone(&self) -> OperatorSignal
fn clone(&self) -> OperatorSignal
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for OperatorSignal
Source§impl Debug for OperatorSignal
impl Debug for OperatorSignal
impl Eq for OperatorSignal
Source§impl PartialEq for OperatorSignal
impl PartialEq for OperatorSignal
impl StructuralPartialEq for OperatorSignal
Auto Trait Implementations§
impl Freeze for OperatorSignal
impl RefUnwindSafe for OperatorSignal
impl Send for OperatorSignal
impl Sync for OperatorSignal
impl Unpin for OperatorSignal
impl UnsafeUnpin for OperatorSignal
impl UnwindSafe for OperatorSignal
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.