Skip to main content

external_ptr_from_sexp

Function external_ptr_from_sexp 

Source
fn external_ptr_from_sexp<T: TypedExternal>(
    sexp: SEXP,
) -> Result<ExternalPtr<T>, SexpError>
Expand description

An ExternalPtr<T> from a bare EXTPTRSXP, or from a class handle carrying one (R6 private$.ptr, S4 ptr slot, S7 .ptr attribute, a list or environment with .ptr; generated Env/S3 handles are already bare EXTPTRSXPs). A pointer unwrapped from a class handle is rooted for the handle’s lifetime: R code can drop the class handle’s reference while Rust holds the pointer, and the finalizer would then free the value.