Expand description
Unified C wrapper generation for standalone functions and impl methods.
This module provides shared infrastructure for generating C wrappers that:
- Handle worker thread vs main thread execution strategies
- Perform parameter conversion from SEXP to Rust types
- Convert Rust return values back to SEXP
- Properly handle panics and R errors
The same infrastructure is used by both #[miniextendr] on standalone functions
and #[miniextendr(env|r6|s3|s4|s7)] on impl blocks.
Structs§
- CWrapper
Context - All information needed to generate a C wrapper function for an R-exported Rust item.
- CWrapper
Context Builder - Builder for
CWrapperContext.
Enums§
- ErrParts
Mode - How the generated
Errarm turns an error value into condition parts (message, class vector, structured data). - Return
Handling - Strategy for converting a Rust return value into an R
SEXP. - Thread
Strategy - Thread execution strategy for C wrappers.
Functions§
- detect_
return_ handling - Detects the
ReturnHandlingstrategy from a return type: the one rule for standalone functions, inherent methods and trait methods. - detect_
return_ 🔒handling_ from_ type - Determines the
ReturnHandlingvariant for a concretesyn::Type. - first_
type_ 🔒argument - Extracts the first generic type argument from a path segment’s angle-bracketed arguments.