The Swift version of #380. This one's mostly being proactive, since the Swift compiler will not optimize across modules at this time without explicitly marking code as inlinable, but it's possible that an operation that creates and destroys an object entirely within the SignalClient module could have the deinitialization of the Swift wrapper happen before the Rust object pointer's final use. The standard withExtendedLifetime protects against this, and the new withNativeHandle wraps that up to access the native object pointer at the same time.
In order to implement this uniformly, I also brought all wrapper objects under a common superclass.
The Swift version of #380. This one's mostly being proactive, since the Swift compiler will not optimize across modules at this time without explicitly marking code as inlinable, but it's possible that an operation that creates and destroys an object entirely within the SignalClient module could have the deinitialization of the Swift wrapper happen before the Rust object pointer's final use. The standard
withExtendedLifetime
protects against this, and the newwithNativeHandle
wraps that up to access the native object pointer at the same time.In order to implement this uniformly, I also brought all wrapper objects under a common superclass.