Skip to main content

Module naming

Module naming 

Source
Expand description

Naming helpers for the static symbols the #[miniextendr] attribute emits.

These formatters live in one place so the attribute macro and any later consumer (e.g. a registration-chasing linter) can compute the exact same identifiers from a source syn::Ident.

Enumsยง

RDataHelper ๐Ÿ”’
The R helpers #[derive(ExternalPtr)] emits for a typeโ€™s sidecar fields and the $ / [[ field methods of r_data_accessors call (#1848).

Constantsยง

R_RESERVED_WORDS ๐Ÿ”’
Rโ€™s reserved words: never usable as a bare name on the left of <-.

Functionsยง

all_equal_c_name ๐Ÿ”’
C_<crate>__mx_all_equal_<Type> โ€” the field reader of the all.equal() method of #[derive(AllEqual)] (#2149).
altrep_reg_fn_ident ๐Ÿ”’
__mx_altrep_reg_<crate>_<Ident> โ€” ALTREP class registration fn.
apply_rename_all ๐Ÿ”’
Apply a rename_all transformation to a variant name.
bare_fn_c_wrapper_ident ๐Ÿ”’
C_<crate>_<fn> โ€” bare-fn C wrapper identifier (internal-wrapper arm only; extern/#[export_name] fns pass through untouched and own their own cross-package uniqueness).
call_slot_ident ๐Ÿ”’
The C wrapperโ€™s call slot, declared by CWrapperContext with quote!. A reference inside a quote_spanned! template would take the user typeโ€™s span instead. That only resolves while the macroโ€™s call site is the userโ€™s, not when the wrapper is generated inside a macro_rules! expansion, as a trait implโ€™s is (#1489). So references interpolate this.
conditional_bound_lifetime ๐Ÿ”’
The binder of a conditional bound, for<'__mx_cond> FieldTy: Trait.
conversion_error_ident ๐Ÿ”’
The error a failed argument conversion binds, for the same reason as call_slot_ident: the binding and the expressions that read it are built in different templates.
crate_prefix ๐Ÿ”’
The consuming crateโ€™s name, used as the prefix for every macro-emitted #[no_mangle] C symbol.
ident_name ๐Ÿ”’
The userโ€™s identifier as a plain name: r#where โ†’ "where", x โ†’ "x".
impl_method_c_wrapper_ident ๐Ÿ”’
C_<crate>_<Type>__<method> โ€” impl-method C wrapper identifier.
is_r_package_name ๐Ÿ”’
Rโ€™s rule for a package name (Writing R Extensions, โ€œThe DESCRIPTION fileโ€): ASCII letters, digits and ., at least two characters, starting with a letter and not ending in ..
is_r_reserved_word ๐Ÿ”’
Whether name is one of Rโ€™s reserved words (if, in, TRUE, NA, โ€ฆ).
is_syntactic_r_name ๐Ÿ”’
Whether name is a syntactic R name: ASCII letters, digits, . and _ only; starts with a letter, or with a . that is not followed by a digit; and is not a reserved word. Anything else ([.foo, $.foo, ==.foo, %in%.foo) has to be backtick-quoted in source.
name_ident ๐Ÿ”’
A name (a column / list-element name, from a user field or a rename) as a Rust identifier for a generated struct field or binding. Keywords come back raw so type emits r#type instead of an unparsable token stream.
parse_generic ๐Ÿ”’
Parse a generic = "..." value. A generic may name its package, pkg::generic, with a valid R package name (ASCII letters, digits and .; at least two characters; starts with a letter; doesnโ€™t end in .) and one ::.
parse_r_receiver ๐Ÿ”’
Parse a dispatch receiver that is safe to emit as a bare R symbol.
r_def_name ๐Ÿ”’
The left-hand side of a generated <name> <- function(...) definition.
r_namespace_name ๐Ÿ”’
The argument of a raw NAMESPACE directive such as export(<name>).
r_string_escape ๐Ÿ”’
Escape s for the inside of an R double-quoted string literal. Every generated R string literal built from user text goes through this (the precondition requirement text and the authorโ€™s messages, the class names in inherits(), lifecycle arguments).
r_wrapper_const_ident_for ๐Ÿ”’
Identifier for the registration entry holding the R wrapper source.
rdata_helper_name ๐Ÿ”’
.rdata_<helper>_<Type>: the R name of a sidecar field helper, named by the Rust type (not an implโ€™s class = "..."), since the derive only knows the type.
self_sexp_ident ๐Ÿ”’
The C wrapperโ€™s receiver slot, shared with method extraction and return handling. Its mixed-site span keeps a user parameter named self_sexp from replacing the original R handle after conversion.
sidecar_fallback_c_name ๐Ÿ”’
C_<crate>__mx_rdata_fallback_<Type> โ€” the field fallback of an S3, S4 or env class with r_data_accessors (fallback = "Self::f", #2150), which the impl block that has it emits.
sidecar_fallback_names_c_name ๐Ÿ”’
C_<crate>__mx_rdata_names_<Type> โ€” the names the field fallback answers, for .DollarNames() (fallback_names = "Self::g", #2150).
sidecar_getter_c_name ๐Ÿ”’
C_<crate>__mx_rdata_get_<Type>_<field> โ€” sidecar field getter C symbol.
sidecar_live_c_name ๐Ÿ”’
C_<crate>__mx_rdata_live_<Type> โ€” the liveness check of a type with #[externalptr(restored(refuse = "every_read"))] (#1901).
sidecar_setter_c_name ๐Ÿ”’
C_<crate>__mx_rdata_set_<Type>_<field> โ€” sidecar field setter C symbol.
split_generic ๐Ÿ”’
A generic = "..." value split into its package and the genericโ€™s own name: "dplyr::dplyr_reconstruct" is (Some("dplyr"), "dplyr_reconstruct"), "print" is (None, "print"). The value must have passed parse_generic.
to_kebab_case ๐Ÿ”’
Convert a PascalCase string to kebab-case (InProgress โ†’ in-progress).
to_snake_case ๐Ÿ”’
Convert a PascalCase string to snake_case.
trait_dispatch_ident ๐Ÿ”’
Trait dispatch registration; uses the same type suffix as its vtable.
trait_impl_wrappers_ident ๐Ÿ”’
Wrapper fragment registered by either trait impl expansion path.
trait_member_c_wrapper_ident ๐Ÿ”’
Same as trait_member_c_wrapper_string, as a syn::Ident for Rust token generation.
trait_member_c_wrapper_string ๐Ÿ”’
C_<crate>_<Type>__<Trait>__<member> as a String โ€” shared by TraitMethod and TraitConst, and by both the ident and string forms each needs, so the format string canโ€™t drift across the four call sites that used to duplicate it.
trait_metadata_macro_ident ๐Ÿ”’
A private export name for a traitโ€™s metadata macro. The public macro is re-exported beside the trait under the traitโ€™s own name, in Rustโ€™s separate macro namespace, so imports carry both. An expansion-local suffix prevents same-named traits in different modules from colliding at the crate root. This name never enters the trait tag or any C/wasm registration symbol.
trait_method_shim_ident ๐Ÿ”’
Generic shim defined beside a non-generic trait.
trait_tag_ident ๐Ÿ”’
Trait tag, shared by the declaration and both impl expansion paths.
trait_vtable_builder_ident ๐Ÿ”’
Trait vtable builder, defined beside the trait and called from its impls.
unraw ๐Ÿ”’
The userโ€™s identifier without its r# prefix, for format_ident! / quote! interpolation into synthesized identifiers (__storage_where). Not for emitting the identifier itself โ€” where is not a valid binding.
vtable_layout_ident ๐Ÿ”’
Local repr(C) type for a concrete trait vtable. Only the static beside it is exported to C; this type reproduces the declarationโ€™s supplied layout.
vtable_static_ident ๐Ÿ”’
__VTABLE_<crate>_<Trait>_FOR_<Type> โ€” trait-impl vtable static. Preserve spelling: Rust distinguishes Counter from counter, as must both the Rust identifier and the exported linker symbol. type_name may carry the existing generic-argument hash suffix.
vtshim_ident ๐Ÿ”’
__vtshim_<crate>_<Type>__<Trait>__<method> โ€” trait-impl vtable shim fn.