pub unsafe fn repanic_if_rust_error(sexp: SEXP)Expand description
Inspect a SEXP returned by a trait-ABI vtable shim and, if it is a tagged
error value, re-panic with the reconstructed RCondition.
This is the “re-panic at the View boundary” step of Approach 1 from the issue-345 plan. The caller (a generated View method wrapper) does:
ⓘ
let result = { vtable_call };
::miniextendr_api::trait_abi::repanic_if_rust_error(result);
// ... convert result normally if we reach hereWhen sexp is a tagged error value:
RCondition::Error/RCondition::Warning/ etc. →panic_any!(cond). The outerwith_r_unwind_protectin the consumer’s C entry point will catch this and produce a tagged SEXP for the consumer’s R wrapper.
When sexp is a normal value: this is a no-op.
§Safety
Must be called from R’s main thread. sexp must be a valid (possibly
tagged) SEXP.