Expand description
Tagged error value transport for #[miniextendr(error_in_r)] mode.
When error_in_r is enabled, Rust-origin failures (panics, Result::Err,
Option::None) are converted to a tagged SEXP value instead of raising an
R error immediately. The generated R wrapper inspects this tagged value and
escalates it to a proper R error condition past the Rust boundary.
This ensures Rust destructors run cleanly before R sees the error.
§Condition value structure (make_rust_condition_value)
The tagged SEXP is a 4-element named list:
error: error message (character scalar)kind: condition kind string — one of the constants inkindclass: optional user-supplied custom class (character scalar orNULL)call: the R call SEXP (orNULLif not available)- class attribute:
"rust_condition_value" __rust_condition__attribute:TRUE
Modules§
- kind
- Canonical kind strings for tagged condition values.
Functions§
- make_
rust_ condition_ value - Build a tagged condition-value SEXP for transport across the Rust→R boundary.
- to_
cstring_ 🔒lossy - Convert a
&strto aCString, falling back tofallbackon interior NUL bytes.