pub(super) fn generate_vtable_static(
impl_item: &ItemImpl,
trait_path: &Path,
concrete_type: &Type,
class_system: ClassSystem,
blanket: bool,
internal: bool,
noexport: bool,
) -> TokenStreamExpand description
Generate the vtable static, C wrappers, R wrappers, and call defs for a trait implementation.
This is the main entry point for trait impl codegen. For a given
impl Trait for Type { ... } block, it produces:
- The cleaned original impl block (with
#[miniextendr]attrs stripped from methods) - A
static __VTABLE_{TRAIT}_FOR_{TYPE}: {Trait}VTableconstant - C wrapper functions and
R_CallMethodDefentries for each method and const - R wrapper code string (class-system specific)
- Two
constitems:{TYPE}_{TRAIT}_CALL_DEFSandR_WRAPPERS_{TYPE}_{TRAIT}_IMPL
ยงArguments
impl_item: The parsedimpl Trait for Typeblocktrait_path: Full path to the trait (e.g.,crate::Counter)concrete_type: The implementing type (e.g.,MyCounter)class_system: Which R class system (env, r6, s3, s4, s7) to generate wrappers forblanket: If true, skip emitting the impl block (a blanket impl already provides it)internal: If true, add@keywords internalto R documentationnoexport: If true, suppress@exportin R documentation