Rantanen / intercom

Object based cross-language FFI for Rust
MIT License
63 stars 7 forks source link

Remove #[com_impl] #161

Closed Rantanen closed 4 years ago

Rantanen commented 4 years ago

Previously #[com_impl] was needed for constructing the struct specific virtual table as it was the one place where the Rust syntax exposed the struct, the interface and the functions.

The changes here manage to do that in #[com_interface] and #[com_class] by creating generic prototype methods in the #[com_interface], which are then instantiated in #[com_class] with the help of the ComClassInterface trait, which is able to communicate the correct virtual table offsets back to #[com_interface] expansion.

Closes #160

Also adds support for generic ComClasses (for example #[com_class] struct ClassFactory<T>).