pub enum SignalPolicy {
Off,
CtrlC,
CtrlCAndTerm,
}Expand description
Which signals trigger an automatic export before termination.
The policy is consulted by the signal-installing layer (module 2); this type only carries the user’s intent so the wiring code can decide which handlers to register. Keeping it as a plain enum (rather than a bitfield) makes the supported combinations explicit and exhaustive.
Variants§
Off
No signal handler installed. Only Drop + panic-hook cover exit paths.
CtrlC
Catch SIGINT (Ctrl-C) only. This is the default policy.
CtrlCAndTerm
Catch both SIGINT and SIGTERM.
§Current limitation
SIGTERM is NOT yet wired up — only SIGINT is caught by the underlying
ctrlc crate. SIGTERM support requires signal_hook (or a raw libc
handler) and will be added when that dependency is approved. Selecting
this policy currently behaves identically to SignalPolicy::CtrlC
from the perspective of which signals actually trigger an export.
Trait Implementations§
Source§impl Clone for SignalPolicy
impl Clone for SignalPolicy
Source§fn clone(&self) -> SignalPolicy
fn clone(&self) -> SignalPolicy
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 SignalPolicy
Source§impl Debug for SignalPolicy
impl Debug for SignalPolicy
Source§impl Default for SignalPolicy
impl Default for SignalPolicy
Source§fn default() -> SignalPolicy
fn default() -> SignalPolicy
Source§impl<'de> Deserialize<'de> for SignalPolicy
impl<'de> Deserialize<'de> for SignalPolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for SignalPolicy
Source§impl PartialEq for SignalPolicy
impl PartialEq for SignalPolicy
Source§impl Serialize for SignalPolicy
impl Serialize for SignalPolicy
impl StructuralPartialEq for SignalPolicy
Auto Trait Implementations§
impl Freeze for SignalPolicy
impl RefUnwindSafe for SignalPolicy
impl Send for SignalPolicy
impl Sync for SignalPolicy
impl Unpin for SignalPolicy
impl UnsafeUnpin for SignalPolicy
impl UnwindSafe for SignalPolicy
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more