# indexmap

> Rust hash map and set that keep insertion order and index entries

Source: https://talira.ai/catalog/indexmap-jmq3c2ec
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / data structures / hashes](https://talira.ai/categories/libraries/data-structures/hashes), [languages / rust](https://talira.ai/categories/languages/rust)
- Licence: Apache-2.0 OR MIT[^2]
- Pricing: Free and open source[^2]
- Free tier: yes[^2]
- Backed by: [indexmap-rs](https://talira.ai/orgs/indexmap-rs.md)

indexmap is a pure-Rust hash table whose iteration order doesn't depend on the keys' hashes: it keeps insertion order (until you remove entries in a way that reorders them) and lets you look entries up by key or by numerical index. It was inspired by Python 3.6's compact dict, stores a raw hash table of indices beside a vector of key-value pairs, and uses hashbrown for the inner table as the standard library's HashMap does, so iteration is very fast. It works without std. It was first released as ordermap, which now exists as a wrapper over it with stronger ordering guarantees.

## Links

- GitHub: https://github.com/indexmap-rs/indexmap
- Docs: https://docs.rs/indexmap/

## Problems it solves

- keep a Rust HashMap's keys in the order I inserted them
- get a hash map entry in Rust by its position as well as its key
- iterate over a large Rust map quickly in a stable order

## Features

- IndexMap and IndexSet keep insertion order
- Look entries up by key or by numerical index
- Fast iteration over densely stored entries
- shift_remove keeps relative order; swap_remove is faster
- Works in no_std environments

## Limitations

- Insertion order isn't kept after swap_remove or other methods that explicitly reorder entries.[^1]

## Trust

Overall: 0.46 out of 1.
Signals: maintenance 0.48, adoption 0.68, momentum 0.40, community 0.71, backing 0.30, extensibility 0.00.

- last commit 2 months ago
- 4 commits in the last 90 days
- 2.5k GitHub stars
- 59 contributors
- backed by indexmap-rs

## Alternatives

- [hashbrown](https://talira.ai/catalog/hashbrown-ewttdp0d.md): SwissTable-based HashMap and HashSet for Rust, the implementation behind the standard library's
- [Rust-PHF](https://talira.ai/catalog/rust-phf-45g8awr0.md): Compile-time perfect-hash lookup tables for Rust

## Sources

[^1]: https://github.com/indexmap-rs/indexmap/blob/main/README.md (checked 28 Nov 2026)
[^2]: https://github.com/indexmap-rs/indexmap/blob/main/Cargo.toml (checked 28 Nov 2026)
