Function with_exit_callback

Source
pub fn with_exit_callback<F: Fn() + Send + Sync + 'static>(closure: F)
Examples found in repository?
examples/exit_callback.rs (lines 4-6)
3fn main() {
4    with_exit_callback(|| {
5        println!("Exit callback called!");
6    });
7
8    tprintln!("Press Ctrl+C to exit the program.");
9
10    loop {
11        std::thread::sleep(std::time::Duration::from_secs(1));
12    }
13}