pub fn generate_vctrs_r_wrapper(parsed_impl: &ParsedImpl) -> StringExpand description
Generates the complete R wrapper string for a vctrs-compatible S3 class.
This is used when an impl block is annotated with #[miniextendr(vctrs)].
Unlike the #[derive(Vctrs)] macro (which generates standalone S3 methods from
struct attributes), this generator produces class wrappers from impl block methods.
Produces the following R code:
- Constructor:
new_<class>(...)that calls the Rustnewconstructor, then wraps the result withvctrs::new_vctr(),vctrs::new_rcrd(), orvctrs::new_list_of()depending on theVctrsKind vec_ptype_abbr.<class>: compact abbreviation for printing (ifabbris specified)vec_ptype2.<class>.<class>: self-coercion prototype (returns empty typed vector)vec_cast.<class>.<class>: identity cast (returnsxunchanged)- Instance methods: S3 generics +
<generic>.<class>methods, with support for vctrs protocol overrides via#[miniextendr(vctrs_protocol = "...")]and double-dispatch class suffixes via#[miniextendr(class = "...")] - Static methods: regular functions named
<class>_<method>(...)
Roxygen2 documentation and @importFrom vctrs ... tags are generated automatically.