Crate linked_hash_set

source ·
Expand description

A linked hash set implementation based on the linked_hash_map crate. See LinkedHashSet.

§Examples

let mut set = linked_hash_set::LinkedHashSet::new();
assert!(set.insert(234));
assert!(set.insert(123));
assert!(set.insert(345));
assert!(!set.insert(123)); // Also see `insert_if_absent` which won't change order

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

Structs§

  • A lazy iterator producing elements in the difference of LinkedHashSets.
  • A lazy iterator producing elements in the intersection of LinkedHashSets.
  • An owning iterator over the items of a LinkedHashSet.
  • An iterator over the items of a LinkedHashSet.
  • 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.
  • A lazy iterator producing elements in the symmetric difference of LinkedHashSets.
  • A lazy iterator producing elements in the union of LinkedHashSets.