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

  • Ok if the signal handler was registered successfully.
  • Err if a handler was already registered for the given signal.