rust-lang/rust — pull request #15623 by nham (2014-07-11 23:31:07+00:00)
Title: libcollections: Add a Multiset data structure.

This is not finished, but I want some feedback before I go too far on my own. This defines two new traits, `Multiset` and `MutableMultiset`. I currently have a partial implementation of this trait, `TreeMultiset`, based on TreeMap, and I plan to add another one based on HashMap. I have based the traits and the `TreeMultiset` implementation closely on the Set traits and on `TreeMultiset`.

The `TreeMultiset` implementation is missing a few things, notably union, intersection, difference and symmetric difference operations (and the iterators that go along with them). I also plan on adding a multiset sum operation, which is distinct from multiset union (see [this Wikipedia page](http://en.wikipedia.org/wiki/Multiset#Multiplicity_function) for reference). I know there are some traits that TreeSet implements that are missing from TreeMultiset as well.

Does this look like a promising route to go?