Expand description
S4 slot access and class checking helpers.
For new packages, S7 is the
recommended class system (use #[miniextendr(s7)]). These S4 helpers
exist for interoperating with existing S4 packages β for example,
reading slots from Bioconductor objects passed as function arguments.
Since Rβs C API for S4 slot access (R_has_slot, R_do_slot,
R_do_slot_assign) is not exposed in miniextendrβs FFI bindings,
these helpers use R expression evaluation via RCall
as a fallback.
All functions require being called from the R main thread and operate
Re-exportsΒ§
use crate::expression::RCall;πuse crate::expression::REnv;πuse crate::expression::REvalError;πuse crate::SEXP;πuse crate::SexpExt;π
FunctionsΒ§
- methods_
namespace π β - Get the
methodspackage namespace for evaluating S4 functions. - s4_
class_ βname - Extract the S4 class name from an object.
- s4_
get_ βslot - Get the value of a named slot from an S4 object.
- s4_
has_ βslot - Check if an S4 object has a named slot.
- s4_isβ
- Check if a SEXP is an S4 object.
- s4_
set_ βslot - Set the value of a named slot on an S4 object.
- scalar_
string π - Create a scalar R character string from a Rust
&str.