You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Call internally stores a reference to the Session, and similarly Session store a reference to the Instance.
I think it would be useful to provide a method that exposes those to the user. This would for instance be useful if we have a Call stored inside a struct. This struct can't also contain the session and instance, because of the lifetime requirements. So whenever the function should be called (and results inspected) the session and instance has to be provided externally.
By the way a small design question: I think the references to instance and session inside the Call and Session struct shouldn't strictly speaking be necessary, because the C structures already contain references to those. And since those references use atomic refcounts, the underlying C session and instance will always outlive the Call even without any rust lifetime checks. So is the reference on the rust level really necessary for something, or just to make the logic cleaner?
The text was updated successfully, but these errors were encountered:
I think it would be useful to provide a method that exposes those to the user. This would for instance be useful if we have a Call stored inside a struct. This struct can't also contain the session and instance, because of the lifetime requirements. So whenever the function should be called (and results inspected) the session and instance has to be provided externally.
Good point.
By the way a small design question: I think the references to instance and session inside the Call and Session struct shouldn't strictly speaking be necessary, because the C structures already contain references to those. And since those references use atomic refcounts, the underlying C session and instance will always outlive the Call even without any rust lifetime checks. So is the reference on the rust level really necessary for something, or just to make the logic cleaner?
Yes, I should have done it that way, this was just to make the logic cleaner, but this will change as you pointed out.
Feel free tell me if you want to make a PR, or I could work on it this weekend.
Call
internally stores a reference to theSession
, and similarlySession
store a reference to theInstance
.I think it would be useful to provide a method that exposes those to the user. This would for instance be useful if we have a Call stored inside a struct. This struct can't also contain the session and instance, because of the lifetime requirements. So whenever the function should be called (and results inspected) the session and instance has to be provided externally.
By the way a small design question: I think the references to instance and session inside the
Call
andSession
struct shouldn't strictly speaking be necessary, because the C structures already contain references to those. And since those references use atomic refcounts, the underlying C session and instance will always outlive the Call even without any rust lifetime checks. So is the reference on the rust level really necessary for something, or just to make the logic cleaner?The text was updated successfully, but these errors were encountered: