Closed anlumo closed 1 year ago
It's possible to do it right now by using an Arc as part of the type wrapped by RustOpaque, but then it's an unnecessary double-Arc.
Totally agree that we should not have double arc if avoidable. (have cc in the PR)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
👀
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue.
Is your feature request related to a problem? Please describe.
Working with async code (via
Stream
s) with this project means that I have to keep objects around even after the function call itself returns. Due to the ownership rules of Rust, I have to use something likeArc
for this, because both my closure and Dart have to keep a reference to that object around and lifetimes are not transferred over the bridge.RustOpaque
is already halfway there by using anOption<Arc<_>>
internally. However, the Rust code doesn't have access to that field.Describe the solution you'd like
RustOpaque
should implement a function that returns a clone of the innerArc
.Describe alternatives you've considered
It's possible to do it right now by using an
Arc
as part of the type wrapped by RustOpaque, but then it's an unnecessary double-Arc
.Additional context
The PR is incoming, this ticket is just there because you require one for the PR.