Skip to main content

s4_has_slot

Function s4_has_slot 

Source
pub unsafe fn s4_has_slot(obj: SEXP, slot_name: &str) -> bool
Expand description

Check if an S4 object has a named slot.

Attempts to access the slot via s4_get_slot. Returns true if the slot exists and is accessible, false if accessing it errors (i.e., the slot does not exist).

ยงSafety

  • obj must be a valid SEXP (typically an S4 object).
  • Must be called from the R main thread.