Skip to main content

Module panic_telemetry

Module panic_telemetry 

Source
Expand description

Structured panic telemetry for debugging Rust panics that become R errors.

Three separate panic→R-error paths exist in miniextendr (worker thread, ALTREP trampolines, and unwind_protect). This module provides a unified hook point that fires before each panic is converted to an R error.

§Usage

use miniextendr_api::panic_telemetry::{set_panic_telemetry_hook, PanicReport, PanicSource};

set_panic_telemetry_hook(|report| {
    eprintln!("[{:?}] panic: {}", report.source, report.message);
});

§Performance

fire() takes a read lock (uncontended in normal use). The hook only fires on panic paths, never on hot paths.

Structs§

PanicReport
A structured panic report passed to the telemetry hook.

Enums§

PanicSource
Describes where a panic originated before being converted to an R error.

Statics§

HOOK 🔒

Functions§

clear_panic_telemetry_hook
Remove the current panic telemetry hook, if any.
fire 🔒
Fire the telemetry hook if one is set.
set_panic_telemetry_hook
Register a panic telemetry hook.

Type Aliases§

Hook 🔒