Skip to main content

Module registry

Module registry 

Source
Expand description

Automatic registration internals.

Items annotated with #[miniextendr] self-register at link time. The C entrypoint calls registry::miniextendr_register_routines to finalize registration with R. Users don’t interact with this module. Automatic registration for miniextendr.

Every #[miniextendr] item self-registers at link time. package_init() (generated by miniextendr_init!) calls miniextendr_register_routines during R_init_* to finalize registration with R. Users never interact with this module.

Re-exportsΒ§

pub use _linkme_macro_MX_CALL_DEFS as MX_CALL_DEFS; πŸ‘»
pub use _linkme_macro_MX_R_WRAPPERS as MX_R_WRAPPERS; πŸ‘»
pub use _linkme_macro_MX_ALTREP_REGISTRATIONS as MX_ALTREP_REGISTRATIONS; πŸ‘»
pub use _linkme_macro_MX_TRAIT_DISPATCH as MX_TRAIT_DISPATCH; πŸ‘»
pub use _linkme_macro_MX_MATCH_ARG_CHOICES as MX_MATCH_ARG_CHOICES; πŸ‘»
pub use _linkme_macro_MX_MATCH_ARG_PARAM_DOCS as MX_MATCH_ARG_PARAM_DOCS; πŸ‘»
pub use _linkme_macro_MX_CLASS_NAMES as MX_CLASS_NAMES; πŸ‘»
pub use _linkme_macro_MX_S7_SIDECAR_PROPS as MX_S7_SIDECAR_PROPS; πŸ‘»

StructsΒ§

AltrepRegistration
ALTREP class registration entry: fn pointer + #[no_mangle] symbol name.
ClassNameEntry
Entry mapping a Rust type name to its R-visible class name and class system.
MatchArgChoicesEntry
Entry for replacing match_arg placeholder defaults with actual choices.
MatchArgParamDocEntry
Entry for replacing match_arg @param doc placeholders with human-readable choice descriptions.
RWrapperEntry
R wrapper code with priority for ordering.
SidecarPropEntry
Entry documenting a sidecar (#[r_data]) property on an S7 ExternalPtr type.
TraitDispatchEntry
Trait dispatch entry mapping (concrete_tag, trait_tag) β†’ vtable.

EnumsΒ§

RWrapperPriority
Ordering priority for R wrapper code fragments.

StaticsΒ§

MX_ALTREP_REGISTRATIONS
ALTREP class registration entries, called once at package init.
MX_CALL_DEFS
R .Call method registrations (function + method C wrappers).
MX_CLASS_NAMES
Class name entries mapping Rust type names to R-visible class names. Host-only.
MX_MATCH_ARG_CHOICES
Match-arg choices entries for R wrapper post-processing. Host-only.
MX_MATCH_ARG_PARAM_DOCS
Match-arg @param doc entries for R wrapper post-processing. Host-only.
MX_R_WRAPPERS
R wrapper code fragments with priority for ordering. Host-only.
MX_S7_SIDECAR_PROPS
S7 sidecar property documentation entries. Host-only.
MX_TRAIT_DISPATCH
Trait dispatch entries for universal_query.

FunctionsΒ§

altrep_regs πŸ”’
call_defs πŸ”’
Native: read directly from the linkme distributed slice. wasm32: read from a OnceLock populated by install_wasm_runtime_slices.
collect_r_wrappers
Collect all R wrapper entries, sorted by priority and deduplicated.
find_substr πŸ”’
Find the first occurrence of needle in haystack[from..]. Returns the absolute index in haystack, or None.
has_no_rd_tag πŸ”’
Check if an R wrapper fragment has @noRd.
has_rdname_tag πŸ”’
Check if an R wrapper fragment already has an @rdname tag.
inject_rdname πŸ”’
Inject #' @rdname <value> (and @title if missing) into an R wrapper fragment. Inserts before the first @export/@keywords/@source line, or after the last roxygen line.
memchr πŸ”’
Find the first byte equal to needle in haystack[from..]. Returns the absolute index, or None.
miniextendr_register_routines⚠
Register all #[miniextendr] routines and ALTREP classes with R.
miniextendr_write_wasm_registry⚠
C-callable entry point for wasm_registry.rs generation via cdylib.
miniextendr_write_wrappers⚠
C-callable entry point for R wrapper generation via cdylib.
normalize_source_locs πŸ”’
Replace every (<stem>.rs:LINE:COL) occurrence with (<stem>.rs:_:_).
rdname_from_source_file πŸ”’
Derive an @rdname value from a source file path.
rotate_choices_for_default πŸ”’
Rotate a comma-separated quoted-choice string so preferred is first.
scan_digits πŸ”’
Advance past a run of ASCII digits starting at haystack[from]. Returns the absolute index of the first non-digit byte, or None if there are no digits at from (empty run is not valid).
sort_s7_classes πŸ”’
Sort S7 class definitions so parents come before children.
trait_dispatch πŸ”’
universal_query⚠
Universal query function for trait dispatch.
wrappers_semantically_equal πŸ”’
Returns true when a and b are equal after normalising away (<file>.rs:LINE:COL) positional suffixes in source-attribution comments.
write_r_wrappers_to_file
Write all R wrapper entries to a file.