-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mutable reference on owner in builder #59
Comments
Hi, this has been discussed here a couple of times, for example here #36. It's one of the main differences to ouroboros API wise, allowing it easily leads to UB, the available API would need to be more variable than it is now. Although now that I'm revisiting the topic I have a new idea how it could be tackled without making the API variable. |
* Add support for mut ref dependents This has feature that has been requested multiple times by users, #36 and #59. * Fix accidental std usage. * Model unlocked -> locked via unlocked by construction This is less code, less run-time work and conceptually harder to miss-use. Win-win. * Remove unnecessary lock code and switch to AtomicBool
Tested successfully: |
Cool! I plan on doing another feature, after which I plan on releasing a new version that contains |
Thanks for implementing this feature - please consider uploading a release that contains it. It'd be nice to replace uses of ouroboros with self-cell, as self-cell generates much less code. But the switch is blocked by cases where the builder requires a mutable owner (and it doesn't make sense to use two self-referential crates in the same workspace). |
Thanks for the reminder, I have to admit to myself that the idea will just not be ready soon so while it would have been nice to have a bigger 1.1 release, let's just release this. |
@gwenn I just released v1.1.0 with that version you should be able to port the rusqlite use cases. |
@Voultapher |
Would it be possible to have
&'a mut $Owner
:instead of
(use case: https://github.com/rusqlite/rusqlite/pull/1462/files#diff-c595ea0bc5c6bee5e8dfc649ad92279225e2e9a354b8f4d355fbaf4012ebe1e8R19)
The text was updated successfully, but these errors were encountered: