Expand description
Unified FFI guard for catching panics at Rust-R boundaries.
Four modules independently catch panics at FFI boundaries: worker.rs,
altrep_bridge.rs, unwind_protect.rs, and connection.rs. This module
extracts the common pattern into a single guarded_ffi_call function.
§Guard Modes
-
GuardMode::CatchUnwind: Wraps the closure incatch_unwind. On panic, fires telemetry and raises an R error viaRf_error(diverges). Used by worker and connection trampolines. -
GuardMode::RUnwind: UsesR_UnwindProtectto catch both Rust panics and R longjmps. Used by ALTREP callbacks that call R APIs.
The ALTREP-specific Unsafe mode (no protection at all) stays in
altrep_bridge.rs since it has no general applicability.
Enums§
- Guard
Mode - FFI guard mode controlling how panics are caught at Rust-R boundaries.
Functions§
- guarded_
ffi_ call - Execute
finside an FFI guard selected bymode. - guarded_
ffi_ call_ with_ fallback - Execute
finside aCatchUnwindguard, returningfallbackon panic.