Expand description
RValue — an owned, Send, R-native value tree.
The serde_json::Value analogue for R’s base data types: an owned (no live
SEXP), inspectable (Debug + Clone), Send (crosses the worker boundary)
representation of “an arbitrary R native value”. Use it wherever you need to
carry a dynamic/heterogeneous R value through Rust — e.g. condition data =
payloads, which travel through panic_any and may be raised on the worker
thread where a live SEXP would be illegal.
The variants enumerate R’s (finite, closed) data type system — vectors only,
since R has no true scalars. NA is modelled with Option where R carries it
out of band (logical/integer/character); Double carries NA in the NA_REAL
bit pattern inside Vec<f64> (no Option), matching R’s in-band convention.
Out of scope (existing homes): closures/environments/symbols/language objects
(not data), S4 objects, EXTPTRSXP (use crate::externalptr::ExternalPtr),
ALTREP internals. Attribute-carrying values (factor, Date, POSIXct) are
modelled as their plain Integer/Double storage in v1 — richer handling is
deferred until a consumer needs it.
Macros§
- try_
from_ 🔒scalar_ opt TryFrom<RValue>for a scalar pulled from a length-1 Option-backed variant.- try_
from_ 🔒vec TryFrom<RValue>for the whole vector of a single variant (NA preserved).
Enums§
- RValue
- An owned,
Send, R-native value tree. See the module docs.
Functions§
- list_
into_ 🔒sexp - Build a
VECSXPfrom list pairs, recursing into each child. - wrong_
type 🔒 Typeerror for a variant mismatch: the value’sSEXPTYPEvs the expected one.