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

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

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 return` if the closure did not panic, and will return Err(cause)`Err(cause)if the closure panics. The` if the closure panics. The cause`cause` returned is the object with which panic was originally invoked.

This function also is unsafe for a variety of reasons: