Enum interprocess_docfix::os::windows::signal::SignalHandler
source · pub enum SignalHandler {
Default,
Ignore,
Hook(SignalHook),
NoReturnHook(NoReturnSignalHook),
}signals only.Expand description
A signal handling method.
Variants§
Default
Use the default behavior specified by the C standard.
Ignore
Ignore the signal whenever it is received.
Hook(SignalHook)
Call a function whenever the signal is received. The function can return, execution will continue.
NoReturnHook(NoReturnSignalHook)
Call a function whenever the signal is received. The function must not return.
Implementations§
source§impl SignalHandler
impl SignalHandler
sourcepub const fn is_default(self) -> bool
pub const fn is_default(self) -> bool
Returns true for the Default variant, false otherwise.
sourcepub const fn is_hook(self) -> bool
pub const fn is_hook(self) -> bool
Returns true for the Hook and NoReturnHook variants, false otherwise.
sourcepub unsafe fn from_fn(function: fn()) -> Self
pub unsafe fn from_fn(function: fn()) -> Self
Creates a handler which calls the specified function.
Safety
The function must not call any C functions which are not considered signal-safe. See the module-level section on signal-safe C functions for more.
sourcepub unsafe fn from_fn_noreturn(function: fn() -> !) -> Self
pub unsafe fn from_fn_noreturn(function: fn() -> !) -> Self
Creates a handler which calls the specified function and is known to never return.
Safety
The function must not call any C functions which are not considered signal-safe. See the module-level section on signal-safe C functions for more.
Trait Implementations§
source§impl Clone for SignalHandler
impl Clone for SignalHandler
source§fn clone(&self) -> SignalHandler
fn clone(&self) -> SignalHandler
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for SignalHandler
impl Debug for SignalHandler
source§impl Default for SignalHandler
impl Default for SignalHandler
source§fn default() -> Self
fn default() -> Self
Returns SignalHandler::Default.
source§impl PartialEq<SignalHandler> for SignalHandler
impl PartialEq<SignalHandler> for SignalHandler
source§fn eq(&self, other: &SignalHandler) -> bool
fn eq(&self, other: &SignalHandler) -> bool
self and other values to be equal, and is used
by ==.