Skip to main content

attach

Function attach 

Source
pub(crate) unsafe fn attach<T: TypedExternal>(sexp: SEXP) -> Attach
Expand description

Gives sexp, a pointer without an address, the value its save decoded, when T is serde and the save carries one (#2186): the first access of a pointer readRDS() gave back. Raises nothing: a failure stays in the carrier, for the caller’s refusal (super::refuse_restored) to name as e$parent.

The pointer gets a protection list in this version’s layout, as a save by any version of the crate is attached: its type ID and slot names, the saved user slot, for each Sidecar field the saved slot of its R name (#2187) or else the decoded value’s pending value (#[serde(skip)] gives the field’s Default), and the carrier, which holds the pointer from now on.

§Safety

On R’s main thread, with sexp a valid EXTPTRSXP without an address, rooted for the call.