pub unsafe fn protect(x: SEXP) -> TlsRootExpand description
Protect a value using the current TLS scope.
§Panics
Panics if called outside of a with_protect_scope block.
§Safety
- Must be called from the R main thread
xmust be a valid SEXP- Must be called within a
with_protect_scopeblock
§Example
ⓘ
tls::with_protect_scope(|| {
let x = tls::protect(some_sexp);
// use x...
})