Skip to main content

derive_external_ptr

Function derive_external_ptr 

Source
pub fn derive_external_ptr(input: DeriveInput) -> Result<TokenStream>
Expand description

Main entry point for #[derive(ExternalPtr)].

Orchestrates the full derive expansion:

  1. Parses #[externalptr(...)] attributes for class system selection.
  2. Analyzes struct fields for #[r_data] sidecar slots.
  3. Generates TypedExternal impl (type identity for ExternalPtr<T>).
  4. Generates IntoExternalPtr marker impl (enables IntoR blanket impl).
  5. Generates sidecar accessor FFI functions, registration constants, and R wrappers.

Returns the combined token stream of all generated items.