pub type mx_meth = unsafe extern "C" fn(data: *mut c_void, argc: i32, argv: *const SEXP) -> SEXP;Expand description
Method signature for trait vtable entries.
All trait methods are erased to this uniform signature:
data: Pointer to the concrete object dataargc: Number of arguments inargvargv: Array of SEXP arguments from R- Returns: SEXP result to R
§Argument Handling
The shim generated by #[miniextendr] on a trait is responsible for:
- Checking
argcmatches expected arity - Converting each
argv[i]viaTryFromSexp - Calling the actual method
- Converting the result via
IntoR - Catching panics and converting to R errors
§Safety
This function pointer is unsafe because:
datamust point to valid, properly-aligned data of the expected typeargvmust point toargcvalid SEXP values- Must be called on R’s main thread