-
Notifications
You must be signed in to change notification settings - Fork 31
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
Provide API to go from Guard<Option<Arc<T>>> to Option<Guard<Arc<T>>> #90
Comments
First, I assume you mean Also, I'm not sure if what you describe would rather be done by something like:
Given these options, I'm not sure if such If you still think there's a use case for such method, I'd be open for a pull request, but:
If you need some specific pointers on how to get oriented in the code, you can ask, but I don't really have that much spare time lately and won't be able to write the code myself. |
That was too simplified example, sorry. Proper example should be returning
|
The use case is this: configuration is stored in global variable as:
now I want to write a function which returns a configuration, but initializes if it is not initialized yet:
I'm thinking there should be an operation like:
Similarly,
ArcSwap<Option<Arc<T>>>
could have a shortcut:I don't know if
Guard
can do it transparently, alternatively,arc_swap
can provide something likeSomeGuard<T>
.The text was updated successfully, but these errors were encountered: