Function ctrlc2::try_set_handler
source · pub fn try_set_handler<F>(user_handler: F) -> Result<JoinHandle<()>, Error>
Expand description
The same as ctrlc2::set_handler but errors if a handler already exists for the signal(s).
§Errors
Will return an error if another handler exists or if a system error occurred while setting the handler.