Skip to main content

sidecar_accessor_names

Function sidecar_accessor_names 

Source
fn sidecar_accessor_names(
    sidecar_props: &[SidecarPropEntry],
    class_index: &HashMap<&str, &ClassNameEntry>,
) -> HashMap<String, String>
Expand description

Compute the sidecar accessor function names a #[derive(ExternalPtr)] emits for each #[r_data] field, resolving the R-visible prefix through the class-name registry.

The derive emits two top-level functions per field — <prefix>_get_<field> and <prefix>_set_<field> — where <prefix> is the R-visible class name. That equals the Rust type name unless the impl block set class = "Override", in which case MX_CLASS_NAMES carries the override. We resolve through class_index so the names we attribute match what actually lands in the wrapper file.

Returns a map from accessor function name -> the human-readable producer description used in the collision message.