Function std::rt::unwind::register [] [src]

pub unsafe fn register(f: Callback) -> bool

: this public module should not exist and is highly likely to disappear

Register a callback to be invoked when a thread unwinds.

This is an unsafe and experimental API which allows for an arbitrary callback to be invoked when a thread panics. This callback is invoked on both the initial unwinding and a double unwinding if one occurs. Additionally, the local Thread will be in place for the duration of the callback, and the callback must ensure that it remains in place once the callback returns.

Only a limited number of callbacks can be registered, and this function returns whether the callback was successfully registered or not. It is not currently possible to unregister a callback once it has been registered.