Skip to main content

IndexedSet

Type Alias IndexedSet 

Source
pub type IndexedSet<K> = IndexedMap<K, ()>;
Expand description

Hash set using IndexedMap.

Keys are assigned indexes in insertion order, which can be used to intern them.

§Examples

let mut set = IndexedSet::new();
assert!(set.insert("b"));
assert!(!set.insert("b"));
assert_eq!(set.intern("a"), 1);
assert_eq!(set.index_of(&"a"), Some(1));
assert_eq!(set.index_of(&"c"), None);

Aliased Type§

pub struct IndexedSet<K> { /* private fields */ }