pub trait AltrepSexpExt {
// Required methods
unsafe fn altrep_data2_raw(&self) -> SEXP;
unsafe fn altrep_data2_raw_unchecked(&self) -> SEXP;
unsafe fn set_altrep_data2(&self, data2: SEXP);
unsafe fn set_altrep_data2_unchecked(&self, data2: SEXP);
}Expand description
ALTREP-specific extension methods for SEXP.
These methods wrap the free functions in ffi::altrep, converting
func(x) calls to x.method() calls. This avoids the
clippy::not_unsafe_ptr_arg_deref lint in ALTREP trait method
implementations that receive SEXP as a parameter.
Only data2 (cache) accessors are exposed here; data1 (storage) is
accessed via the AltrepExtract trait or the standalone free functions
altrep_data1_as / altrep_data1_as_unchecked / altrep_data1_mut /
altrep_data1_mut_unchecked.
Required Methods§
Sourceunsafe fn altrep_data2_raw(&self) -> SEXP
unsafe fn altrep_data2_raw(&self) -> SEXP
Get the raw SEXP in the ALTREP data2 slot.
§Safety
selfmust be a valid ALTREP SEXP- Must be called from the R main thread
Sourceunsafe fn altrep_data2_raw_unchecked(&self) -> SEXP
unsafe fn altrep_data2_raw_unchecked(&self) -> SEXP
Get the ALTREP data2 slot (unchecked — no thread routing).
§Safety
selfmust be a valid ALTREP SEXP- Must be called from the R main thread
Sourceunsafe fn set_altrep_data2(&self, data2: SEXP)
unsafe fn set_altrep_data2(&self, data2: SEXP)
Set the ALTREP data2 slot.
§Safety
selfmust be a valid ALTREP SEXP- Must be called from the R main thread
Sourceunsafe fn set_altrep_data2_unchecked(&self, data2: SEXP)
unsafe fn set_altrep_data2_unchecked(&self, data2: SEXP)
Set the ALTREP data2 slot (unchecked — no thread routing).
§Safety
selfmust be a valid ALTREP SEXP- Must be called from the R main thread