Rantanen / intercom

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

Put the struct data into a RefCell within the ComClass #75

Open Rantanen opened 6 years ago

Rantanen commented 6 years ago

Currently the COM calls are skipping borrow checkers and there are no real safeties against calling multiple &mut self methods in parallel.

We should try to achieve the following:

This might need us to expand the #[com_class] attribute with something like #[com_class_mut] or #[com_class(IReadOnlyInterface, mut IWriteInterface)]

Rantanen commented 4 years ago

We might also want Mutex there somewhere. All of this should be controlled by the #[com_class(..)] attribute, ie:

#[com_class(IReadOnlyInterface, mut IWriteInterface, thread_safe)]
or
#[com_class(IReadOnlyInterface, mut IWriteInterface, mutex=true)]
or
#[com_class(IReadOnlyInterface, mut IWriteInterface, Sync)]