linked_hash_set 0.1.0

HashSet with insertion ordering
Documentation

linked_hash_set

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.

extern crate linked_hash_set;
use linked_hash_set::LinkedHashSet;

let mut set = LinkedHashSet::new();
set.insert(234);
set.insert(123);
set.insert(345);
set.insert(123);

assert_eq!(set.into_iter().collect::<Vec<_>>(), vec![234, 345, 123]);