#[repr(transparent)]pub struct CallerCall(SEXP);Expand description
The call of the R function that called this wrapper, as written
(.miniextendr_caller_call(.call) in the generated wrapper), or the call a
helper passed as the wrapper’s .call formal.
Taking it selects caller attribution; the function must be noexport or
internal. See the module docs.
Tuple Fields§
§0: SEXPImplementations§
Methods from Deref<Target = SEXP>§
Sourcepub fn is_null_ptr(self) -> bool
pub fn is_null_ptr(self) -> bool
Is this SEXP a C null pointer (address 0x0)?
This answers a pointer question, not an R question. An SEXP that R
hands you (a .Call() argument, a list element, an attribute) is never
a C null pointer: R’s NULL is the R_NilValue singleton, a real
object at a non-zero address. A C null pointer only shows up where C
code uses address zero for “nothing here”: an uninitialised static or
field (SEXP::null()), an ALTREP data1/data2 slot that was never
set, or an FFI function that returns NULL on failure.
To ask “is this R’s NULL?”, use SEXP::is_nil().
use miniextendr_api::SEXP;
let unset = SEXP::null();
assert!(unset.is_null_ptr());There is no SEXP::is_null(): the name read like a test for R’s
NULL, so it is gone on purpose.
use miniextendr_api::SEXP;
let unset = SEXP::null();
assert!(unset.is_null());See also: SEXP::is_nil(), SEXP::is_null_or_nil(), SEXP::null()
Sourcepub fn is_nil(self) -> bool
pub fn is_nil(self) -> bool
Is this SEXP R’s NULL (R_NilValue)?
This is the check for an R value: an optional argument that defaults
to NULL, an absent attribute, an empty list slot. It compares the
address against the R_NilValue singleton and never dereferences
self, so it is safe on a stale SEXP. A C null pointer is not R’s
NULL; for that, use SEXP::is_null_ptr().
use miniextendr_api::SEXP;
// `x` is an argument whose R default is `NULL`: `f()` and `f(NULL)`
// both arrive as `R_NilValue`.
fn given(x: SEXP) -> bool {
!x.is_nil()
}See also: SEXP::nil(), SEXP::is_null_ptr(), SEXP::is_null_or_nil()
Sourcepub fn is_null_or_nil(self) -> bool
pub fn is_null_or_nil(self) -> bool
Is this SEXP either a C null pointer or R’s NULL?
For a slot that can hold either kind of “nothing”: unset (address
zero) or set to R_NilValue, such as an external pointer’s protected
value. For an R value alone, SEXP::is_nil() is the right check.
use miniextendr_api::SEXP;
// A slot that was never set counts as empty.
assert!(SEXP::null().is_null_or_nil());See also: SEXP::is_nil(), SEXP::is_null_ptr()
Sourcepub unsafe fn altrep_data1_raw(self) -> SEXP
pub unsafe fn altrep_data1_raw(self) -> SEXP
Get the raw SEXP in the ALTREP data1 slot.
§Safety
selfmust be a valid ALTREP SEXP- Must be called from the R main thread
Sourcepub unsafe fn altrep_data1_raw_unchecked(self) -> SEXP
pub unsafe fn altrep_data1_raw_unchecked(self) -> SEXP
Get the raw SEXP in the ALTREP data1 slot (unchecked — no thread routing).
§Safety
selfmust be a valid ALTREP SEXP- Must be called from the R main thread
Sourcepub unsafe fn set_altrep_data1(self, v: SEXP)
pub unsafe fn set_altrep_data1(self, v: SEXP)
Set the ALTREP data1 slot.
§Safety
selfmust be a valid ALTREP SEXP- Must be called from the R main thread
Sourcepub unsafe fn altrep_data2_raw(self) -> SEXP
pub 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
Sourcepub unsafe fn altrep_data2_raw_unchecked(self) -> SEXP
pub unsafe fn altrep_data2_raw_unchecked(self) -> SEXP
Get the raw SEXP in the ALTREP data2 slot (unchecked — no thread routing).
§Safety
selfmust be a valid ALTREP SEXP- Must be called from the R main thread
Sourcepub unsafe fn set_altrep_data2(self, v: SEXP)
pub unsafe fn set_altrep_data2(self, v: SEXP)
Set the ALTREP data2 slot.
§Safety
selfmust be a valid ALTREP SEXP- Must be called from the R main thread
Sourcepub unsafe fn set_altrep_data2_unchecked(self, v: SEXP)
pub unsafe fn set_altrep_data2_unchecked(self, v: 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
Trait Implementations§
Source§impl Clone for CallerCall
impl Clone for CallerCall
impl Copy for CallerCall
Source§impl Debug for CallerCall
impl Debug for CallerCall
Source§impl Deref for CallerCall
impl Deref for CallerCall
Source§impl Eq for CallerCall
impl Eq for CallerCall
Source§#[doc(hidden)]fn assert_fields_are_eq(&self)
#[doc(hidden)]fn assert_fields_are_eq(&self)
derive_eq_internals)1.0.0 (const: unstable) · Source§#[doc(hidden)]fn assert_receiver_is_total_eq(&self)
#[doc(hidden)]fn assert_receiver_is_total_eq(&self)
implementation detail of #[derive(Eq)]
Source§impl From<CallerCall> for SEXP
impl From<CallerCall> for SEXP
Source§fn from(call: CallerCall) -> SEXP
fn from(call: CallerCall) -> SEXP
Source§impl From<CallerCall> for Call
A caller’s call is a call: hand it to an API that takes Call.
impl From<CallerCall> for Call
A caller’s call is a call: hand it to an API that takes Call.
Source§fn from(call: CallerCall) -> Call
fn from(call: CallerCall) -> Call
Source§impl PartialEq for CallerCall
impl PartialEq for CallerCall
impl StructuralPartialEq for CallerCall
impl TrivialClone for CallerCall
Auto Trait Implementations§
impl Freeze for CallerCall
impl RefUnwindSafe for CallerCall
impl Send for CallerCall
impl Sync for CallerCall
impl Unpin for CallerCall
impl UnsafeUnpin for CallerCall
impl UnwindSafe for CallerCall
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ConsumingFallible for Twhere
T: Clone,
impl<T> Printable for T
Source§impl<T> RCopy for Twhere
T: Copy,
impl<T> RCopy for Twhere
T: Copy,
Source§impl<T> RDebug for Twhere
T: Debug,
impl<T> RDebug for Twhere
T: Debug,
Source§impl<T> SizeHint for Twhere
T: ?Sized,
impl<T> SizeHint for Twhere
T: ?Sized,
Source§default fn lower_bound(&self) -> usize
default fn lower_bound(&self) -> usize
core_io_internals)[u8; 12] could return any value between 0 and
12 inclusively as a correct implementation. Read moreSource§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)]const SIZE: usize = _
#[doc(hidden)]const SIZE: usize = _
sized_type_properties)Source§#[doc(hidden)]const ALIGN: usize = _
#[doc(hidden)]const ALIGN: usize = _
sized_type_properties)Source§#[doc(hidden)]const ALIGNMENT: Alignment = _
#[doc(hidden)]const ALIGNMENT: Alignment = _
ptr_alignment_type)Source§#[doc(hidden)]const IS_ZST: bool = _
#[doc(hidden)]const IS_ZST: bool = _
sized_type_properties)Source§#[doc(hidden)]const LAYOUT: Layout = _
#[doc(hidden)]const LAYOUT: Layout = _
sized_type_properties)Source§#[doc(hidden)]const MAX_SLICE_LEN: usize = _
#[doc(hidden)]const MAX_SLICE_LEN: usize = _
sized_type_properties)[Self]. Read moreLayout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes