fn generate_sidecar_accessors(
input: &DeriveInput,
info: &SidecarInfo,
restored: &RestoredOptions,
field_error: &FieldErrorOptions,
) -> Result<TokenStream>Expand description
Generate sidecar accessor constants and extern "C-unwind" functions.
For each public #[r_data] field, generates:
-
A getter FFI function (
C_<crate>__mx_rdata_get_Type_field) -
A setter FFI function (
C_<crate>__mx_rdata_set_Type_field) -
R_CallMethodDefentries for routine registration -
R wrapper function code (roxygen-documented)
-
Class-integration code for R6 / S7 (active bindings / properties)
-
The helpers of the S3 / S4 / env field methods (
generate_field_syntax_helpers) -
With
restored(refuse = "every_read"), the liveness check (C_<crate>__mx_rdata_live_Type, #1901) the field methods call
The generated statics are:
__MX_CALL_DEF_RDATA_*: theR_CallMethodDefentriesR_WRAPPERS_RDATA_{Type}: the R6 / S7 integration, when presentR_SIDECAR_ACCESSORS_{Type}: the standalone accessors, exported and internal, which the wrapper writer picks between by the class’s field syntax (registry::SidecarAccessorsEntry, #1900). Only the internal rendering includes the field-syntax helpers.
Returns Err if the struct has generic type parameters (.Call entrypoints
cannot be generic).