LinkedHashMap

Type Alias LinkedHashMap 

Source
pub type LinkedHashMap<K, V> = LinkedHashMap<K, V, RandomState>;
Expand description

A hash map that maintains the relative order of entries, implemented as a doubly-linked list backed by a hash table for O(1) lookups.

This is the main type alias using the default hasher. For custom hashers, use linked_hash_map::LinkedHashMap directly.

§Examples

use tether_map::LinkedHashMap;

let mut map = LinkedHashMap::new();
map.insert("a", 1);
map.insert("b", 2);

// Maintains relative order
let entries: Vec<_> = map.iter().collect();
assert_eq!(entries, [(&"a", &1), (&"b", &2)]);

Aliased Type§

pub struct LinkedHashMap<K, V> { /* private fields */ }