A linked hash set implemented as a linked_hash_map::LinkedHashMap
where the value is ()
, in a similar way std HashSet
is implemented from HashMap
.
General usage is very similar to a std HashSet
. However, a LinkedHashSet
maintains insertion order using a doubly-linked list running through its entries.
As such methods front()
, pop_front()
, back()
and pop_back()
are provided.
```rust extern crate linkedhashset; use linkedhashset::LinkedHashSet;
let mut set = LinkedHashSet::new(); set.insert(234); set.insert(123); set.insert(345); set.insert(123);
asserteq!(set.intoiter().collect::