21 releases

Uses old Rust 2015

0.5.4 Jan 8, 2021
0.5.3 May 6, 2020
0.5.2 Mar 21, 2019
0.5.1 Jan 29, 2018
0.0.2 Mar 26, 2015

#37 in Database interfaces

Download history 186900/week @ 2021-01-13 198573/week @ 2021-01-20 203685/week @ 2021-01-27 210931/week @ 2021-02-03 203265/week @ 2021-02-10 229847/week @ 2021-02-17 226601/week @ 2021-02-24 216073/week @ 2021-03-03 237203/week @ 2021-03-10 213718/week @ 2021-03-17 218051/week @ 2021-03-24 202571/week @ 2021-03-31 218462/week @ 2021-04-07 213269/week @ 2021-04-14 212663/week @ 2021-04-21 169433/week @ 2021-04-28

778,390 downloads per month
Used in 2,798 crates (138 directly)

MIT/Apache

46KB
936 lines

WARNING: THIS PROJECT IS IN MAINTENANCE MODE, DUE TO INSUFFICIENT MAINTAINER RESOURCES

It works fine, but will generally no longer be improved.

We are currently only accepting changes which:

  • keep this compiling with the latest versions of Rust or its dependencies.
  • have minimal review requirements, such as documentation changes (so not totally new APIs).

A HashMap wrapper that holds key-value pairs in insertion order.

Documentation is available at https://docs.rs/linked-hash-map.


lib.rs:

A HashMap wrapper that holds key-value pairs in insertion order.

Examples

use linked_hash_map::LinkedHashMap;

let mut map = LinkedHashMap::new();
map.insert(2, 20);
map.insert(1, 10);
map.insert(3, 30);
assert_eq!(map[&1], 10);
assert_eq!(map[&2], 20);
assert_eq!(map[&3], 30);

let items: Vec<(i32, i32)> = map.iter().map(|t| (*t.0, *t.1)).collect();
assert_eq!(items, [(2, 20), (1, 10), (3, 30)]);

Dependencies

~115KB