mozilla/rust — pull request #14908 by kvark (2014-06-15 04:07:57+00:00)
Title: Extended Rc uniqueness methods

```maybe_unique()``` allows to mutate the referenced data if the pointer is guaranteed to be the only one.
```is_last_standing()``` allows to check if this pointer is the last strong one.

One possible application of these methods is a shared resource factory. The resource doesn't know how it is built or destroyed, it may even be method-less. The factory knows how to create a resource and how to destroy it. Upon creation, the factory stores ```Rc``` internally and returns a cloned reference. Later, at a designated (by the user) moment, the factory can sweep over known references and delete only those resources that are no longer needed by anyone else (here comes ```maybe_unique``` or ```is_last_standing```).