[][src]Function rosy::protected_no_panic

pub unsafe fn protected_no_panic<F, O>(f: F) -> Result<O> where
    F: FnOnce() -> O, 

Calls the non-panicking function f and returns its output or an exception if one is raised in f.

See protected for usage information.

This function is allowed to perform certain optimizations what wouldn't be possible if it needed to take panics into consideration. This can result in a large reduction of instructions emitted.

Safety

Because f is called within the context of a foreign C function, panicking will cause undefined behavior.