Skip to main content

protected_call

Function protected_call 

Source
pub fn protected_call<T, F>(op: F) -> Result<T, String>
where F: FnOnce() -> T + UnwindSafe,
Expand description

Wrap a potentially-panicking plugin call in catch_unwind. Returns the closure’s result on success, or an error string if it panics.