-
Notifications
You must be signed in to change notification settings - Fork 9
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
Suggestion: SyncFnOnce #11
Comments
Sounds doable at first sight, but it makes me wonder: under which circumstances would you need this? |
I stumbled upon this when I had a type that for other reasons had to be Sync while holding an |
Sorry for the delay, other things kept me from properly thinking this through. The reasoning seems sound to me: SyncWrapper works because it only permits operations on exclusive references, so SyncFnOnce should work, too, because the only thing you can do with it requires you to (exclusively) own the value. Would you like to try your hand at an implementation? |
Hi,
I am no sure if something like a SyncFnOnce wrapper exists and if it would even be possible to implement.
If possible, it would be nice since FnOnce only operation is call_once, which consumes self.
The text was updated successfully, but these errors were encountered: