-
-
Notifications
You must be signed in to change notification settings - Fork 321
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
Moving ShMem persisting to take an owned value #2649
Moving ShMem persisting to take an owned value #2649
Conversation
I see why this is nicer to call, but it feels a bit odd, right? I mean, this is not a builder (yet) but a normal method, kinda.. |
I see where you are coming from. I feel like as long as it is only a single thing it's alright. Alternatives to the custom method would be:
Overall this is probably a pretty niche thing, so maybe it doesn't really matter, and having it in its own function where most people don't have to bother actually has its upsides. |
I'd say let's just go with that option 2, and just add a |
(they can both call down to an internal constructor that takes a boolean, but exposing that boolean wouldn't be very rust-y I think) |
I've now created a custom constructor that calls the "normal" constructor and then sets the flags. What do you think? |
Sounds good |
thanks! |
Small change, makes it much more convenient to use. You'll typically call
persist_for_child_processes
during creation, and if the method takes a borrow, it requires two statements. Now, it can be done in one.