vorner / arc-swap

Support atomic operations on Arc itself
Apache License 2.0
778 stars 31 forks source link

Support Null? #5

Closed vorner closed 6 years ago

vorner commented 6 years ago

It could sometimes be desirable to represent empty state. eg. some form of NULL. On the other hand, every user would then need to explicitly handle the NULL case even if it doesn't happen for them. Is it worth?

Diggsey commented 6 years ago

You could make it generic, ie. Swap<T: RefCounted> and have ArcSwap be an alias, and also implement RefCounted for Option<Arc<T>>

vorner commented 6 years ago

That's actually a nice idea. And it could be also implemented (under a feature) for all these Arcs from other crates without weak counts, etc.

vorner commented 6 years ago

Implemented and released as part of 0.2