Macro ffi_support::implement_into_ffi_by_pointer [−][src]
macro_rules! implement_into_ffi_by_pointer { ($($T : ty), * $(,) *) => { ... }; }
Expand description
Implements IntoFfi
for the provided types (more than one
may be passed in) by allocating $T
on the heap as an opaque pointer.
This is typically going to be used from the “Rust component”, and not the
“FFI component” (see the top level crate documentation for more
information), however you will still need to implement a destructor in the
FFI component using define_box_destructor!
.
In general, is only safe to do for send
types (even this is dodgy, but
it’s often necessary to keep the locking on the other side of the FFI, so
Sync is too harsh), so we enforce this in this macro. (You’re still free to
implement this manually, if this restriction is too harsh for your use case
and you’re certain you know what you’re doing).