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

pub unsafe fn try<F: FnOnce()>(f: F) -> Result<(), Box<Any + Send>>
Unstable

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

Invoke a closure, capturing the cause of panic if one occurs.

This function will return Ok(())`Ok(())if the closure did not panic, and will returnErr(cause)if the closure panics. Thecause` returned is the object with which panic was originally invoked.

This function also is unsafe for a variety of reasons: