Expand description
Result<T, E> conversions to R.
Used by #[miniextendr(unwrap_in_r)] to pass Results to R as values
(Err becomes list(error = ...)), instead of unwrapping in Rust.
Also provides NullOnErr for Result<T, ()> → NULL-on-error semantics.
§Tradeoff
The two impls in this module have different gating conditions:
IntoR for Result<T, E: Display>(thelist(error = ...)shape) fires only under#[miniextendr(unwrap_in_r)](Result-as-value). Without that attribute, aResult<T, E>return acts as an error boundary:Err(e)panics withDebug-formattede, the framework’s tagged-condition transport carries it to R, and the wrapper raises a classedrust_*condition. Failure mode of opting intounwrap_in_rwithout telling R callers: they suddenly need to check$erroron every return value instead of usingtryCatch.IntoR for Result<T, NullOnErr>fires whenever the error type is(), independent ofunwrap_in_r: the macro rewritesResult<T, ()>toResult<T, NullOnErr>before theunwrap_in_rcheck, soErr(())returnsNULLto R in both modes. A unit error is a deliberate “no value” sentinel, not a Rust failure — it never raises an R error.
Structs§
- Null
OnErr - Marker type for
Result<T, ()>that convertsErr(())to NULL.