Function ffi_helpers::panic::catch_panic [−][src]
pub fn catch_panic<T, F>(func: F) -> Result<T, ()> where
F: FnOnce() -> Result<T, Error> + UnwindSafe,
Expand description
Try to execute some function, catching any panics and translating them into errors to make sure Rust doesn’t unwind across the FFI boundary.
If the function returns an error or panics the Error
is passed into
update_last_error()
.