pub(super) fn trait_impl(
    mod_path: &str,
    trait_ident: &Ident,
    items: &[ImplItem]
) -> Result<TokenStream>
Expand description

Generate a trait impl that calls foreign callbacks

This generates:

  • A repr(C) VTable struct where each field is the FFI function for the trait method.
  • A FFI function for foreign code to set their VTable for the interface
  • An implementation of the trait using that VTable