vorner / arc-swap

Support atomic operations on Arc itself

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support Null?

vorner opened this issue · comments

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?

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

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.

Implemented and released as part of 0.2