Function ctrlc::set_handler [] [src]

pub fn set_handler<F>(user_handler: F) -> Result<(), Error> where
    F: Fn() -> () + 'static + Send

Sets up the signal handler for Ctrl-C.

Example

ctrlc::set_handler(|| println!("Hello world!")).expect("Error setting Ctrl-C handler");