Skip to main content

sidecar_r_live

Function sidecar_r_live 

Source
#[doc(hidden)]
pub unsafe fn sidecar_r_live<T: TypedExternal>(x: SEXP, raise: bool) -> bool
Expand description

Whether the receiver x (a pointer, or an object carrying one) still has its Rust value, for the field methods of a type with #[externalptr(restored(refuse = "every_read"))] (#1901), which ask before a read that never reaches an accessor (names(), a name that is not a field).

With raise, a receiver without one is refused as the accessors refuse it (checked_prot with require_live: the type’s restored error, the no-pointer error, or the other-type error) and a live pointer of another type is refused too, so the result is always true. Without it (.DollarNames(), which serves completion and never raises) the answer is whether x carries a pointer with an address: a list or an environment without one, or an atomic vector, has none.

§Safety

Must be called from R’s main thread with a valid x.