[src]

Function std::rt::at_exit

pub fn at_exit(f: proc())

Enqueues a procedure to run when the runtime is cleaned up

The procedure passed to this function will be executed as part of the runtime cleanup phase. For normal rust programs, this means that it will run after all other tasks have exited.

The procedure is not executed with a local Task available to it, so primitives like logging, I/O, channels, spawning, etc, are not available. This is meant for "bare bones" usage to clean up runtime details, this is not meant as a general-purpose "let's clean everything up" function.

It is forbidden for procedures to register more at_exit handlers when they are running, and doing so will lead to a process abort.