pub fn derive_external_ptr(
input: DeriveInput,
emit_into_r_marker: bool,
) -> Result<TokenStream>Expand description
Main entry point for #[derive(ExternalPtr)].
Orchestrates the full derive expansion:
- Parses
#[externalptr(...)]attributes for class system selection. - Analyzes struct fields for
#[r_data]sidecar slots. - Generates
TypedExternalimpl (type identity forExternalPtr<T>). - Generates
IntoExternalPtrmarker impl (enablesIntoRblanket impl) and a concreteIntoRVecElementimpl (enables theIntoR for Vec<T>blanket, so-> Vec<MyType>returns aVECSXPof external pointers — #1284). Both are suppressed whenemit_into_r_markerisfalse, which the struct-level#[miniextendr(prefer = "native")]path uses so its concreteAsRNativeIntoRdoes not collide with the blanketIntoExternalPtrIntoR(E0119, #1283). - Generates sidecar accessor FFI functions, registration constants, and R wrappers.
Returns the combined token stream of all generated items.