exit

Function exit 

Source
pub fn exit(code: i32) -> !
Examples found in repository?
examples/base.rs (line 8)
4fn main() {
5    will_exit::init(2000).unwrap();
6    std::panic::set_hook(Box::new(|info| {
7        println!("{}", info);
8        will_exit::exit(-1);
9    }));
10
11    thread::spawn(|| {
12        thread::sleep(Duration::from_secs(6));
13        will_exit::exit(0);
14    });
15    loop {
16        if will_exit::will_exit() {
17            break;
18        }
19        thread::sleep(Duration::from_millis(100));
20    }
21    println!("exit");
22}