Skip to main content

Module panic

Module panic 

Source
Expand description

Catch-unwind wrapper used by every plug-in extern "C" thunk.

Unwinding across an FFI boundary is undefined behaviour, so every host-bound call from a plug-in must be wrapped to convert a panic into a returned PluginError with code PluginErrorCode::Panic.

Functionsยง

drop_payload
Drops a panic payload while suppressing any unwind from its Drop impl.
guard
Wraps a closure in catch_unwind and maps a panic to a PluginError.
guard_infallible
Runs a closure under catch_unwind for thunks whose return type cannot carry a PluginError (e.g. extern "C" fn(...) -> u64).