Skip to main content

Module mx_abi

Module mx_abi 

Source
Expand description

C-callable mx_abi functions (mx_wrap, mx_get, mx_query, mx_abi_register).

These are registered via R_RegisterCCallable during package init and loaded by consumer packages via R_GetCCallable. Rust implementation of the mx_abi C-callable functions.

These functions are registered with R_RegisterCCallable during package init and loaded by consumer packages via R_GetCCallable.

This module replaces the C implementation that was previously in mx_abi.c.in.

Re-exportsยง

use crate::abi::SIDECAR_INIT_TAG; ๐Ÿ”’
use crate::abi::SidecarInitVTable; ๐Ÿ”’
use crate::abi::mx_erased; ๐Ÿ”’
use crate::abi::mx_tag; ๐Ÿ”’
use crate::gc_protect::OwnedProtect; ๐Ÿ”’
use crate::sys::R_ClearExternalPtr; ๐Ÿ”’
use crate::sys::R_ExternalPtrAddr; ๐Ÿ”’
use crate::sys::R_ExternalPtrTag; ๐Ÿ”’
use crate::sys::R_MakeExternalPtr; ๐Ÿ”’
use crate::sys::R_PreserveObject; ๐Ÿ”’
use crate::sys::R_RegisterCCallable; ๐Ÿ”’
use crate::sys::R_RegisterCFinalizerEx; ๐Ÿ”’
use crate::sys::Rf_install; ๐Ÿ”’
use crate::Rboolean; ๐Ÿ”’
use crate::SEXP; ๐Ÿ”’
use crate::SEXPTYPE; ๐Ÿ”’
use crate::SexpExt; ๐Ÿ”’
use std::ffi::CStr; ๐Ÿ”’
use std::sync::OnceLock; ๐Ÿ”’

Constantsยง

MX_TAG_NAME ๐Ÿ”’
Reserved tag for trait-ABI storage, distinct from ordinary ExternalPtr boxes.

Staticsยง

MX_TAG ๐Ÿ”’
The tag symbol used to identify miniextendr external pointers. SEXP is Send+Sync so OnceLock<SEXP> works directly.

Functionsยง

get_tag ๐Ÿ”’ โš 
Get the miniextendr tag symbol, initializing it if needed.
mx_abi_registerโš 
Register the mx_* C-callables with R.
mx_externalptr_finalizer ๐Ÿ”’ โš 
Finalizer callback for Rโ€™s garbage collector.
mx_getโš 
Extract an erased object pointer from an R external pointer.
mx_queryโš 
Query an object for an interface vtable by tag.
mx_wrapโš 
Wrap an erased object pointer in an R external pointer.