pub fn at_exit<F: FnOnce() + Send + 'static>(f: F) -> Result<(), ()>
Enqueues a procedure to run when the main thread exits.
Currently these closures are only run once the main Rust thread exits.
at_exit handlers begin running, more may be enqueued, but not
infinitely so. Eventually a handler registration will be forced to fail.
Ok if the handler was successfully registered, meaning that the
closure will be run once the main thread exits. Returns
Err to indicate
that the closure could not be registered, meaning that it is not scheduled
to be run.