Expand description
catch_unwind helpers for FFI boundaries between rack and
plugin code.
Plugin libraries are written by third parties. A panic in a
plugin’s process (or any other callback) would unwind
across the extern "C" boundary back into the host —
undefined behaviour on most toolchains, abort on others.
These helpers catch the unwind, log a short diagnostic, and
return a fallback value the wrapper can hand back to its
caller.
Mirrors truce_core::wrapper. The plugin-side framework
catches panics going out of plugin code; the host-side
framework catches panics going in from plugin code. Same
helper shape, opposite direction.
Functions§
- run_
audio_ block - Run a per-audio-block callback body under
catch_unwindwith no fallback value — caller only cares whether the body panicked. - run_
audio_ block_ with - Run a per-audio-block callback body under
catch_unwindwith a fallback return value. Returns the body’s value on clean exit,fallbackon panic. - run_
callable - Convenience: run a plugin callback under
catch_unwindand convert a panic into anError::Panic. Used by thePluginCore/Pluginimpl shims when the callback’s natural error type iscrate::Result<T>. - run_
extern_ callback_ with - Run an
extern "C"plugin callback body (state save / load, parameter formatting, GUI handler) undercatch_unwindwith a fallback return value.actionis logged for debuggability (“save_state”, “load_state”, “format_value”, …).