pub fn generate_s7_r_wrapper(parsed_impl: &ParsedImpl) -> StringExpand description
Generates the complete R wrapper string for an S7-style class.
Produces the following R code:
- Class definition:
ClassName <- S7::new_class("ClassName", ...)with a.ptrproperty ofclass_anyholding theExternalPtr, plus optional computed properties - Constructor: inline in
new_class(constructor = function(...) ...), supports.ptrshortcut parameter for factory methods returningSelf - Properties:
S7::new_property(...)for each getter/setter/validator annotated with#[miniextendr(s7(getter))]etc., with support for class constraints, defaults, required, frozen, and deprecated modifiers - Instance methods:
S7::new_generic(...)+S7::method(generic, class)pairs dispatching to Rust.Call()wrappers viax@.ptr - External generics:
S7::new_external_generic("pkg", "name")for overriding generics from other packages - Multiple dispatch: via
#[miniextendr(s7(dispatch = "x,y"))] - Fallback methods:
S7::method(generic, S7::class_any)withtryCatchfor safe slot access on non-S7 objects - Static methods: regular functions named
ClassName_method(...) - Convert methods:
S7::method(convert, list(From, To))forconvert_fromandconvert_toannotations - S7 parent/abstract: optional
parentandabstract = TRUEin class definition
Roxygen2 documentation and @importFrom S7 ... tags are generated automatically.