Function signal_handler::register_signal_handler
source · pub fn register_signal_handler(
signal: Signal,
handler: Box<dyn SignalHandler>
) -> Result<(), AlreadyRegistered>Expand description
Register a SignalHandler callback function for the current task.
If an exception/error occurs during the execution of the current task,
the given handler will be invoked with details of that exception.
Return
Okif the signal handler was registered successfully.Errif a handler was already registered for the givensignal.