indexmap

A hash table for Rust that preserves insertion order and supports lookup by index

Library
Cargo
v2.14.0
2,411stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
51/100Fair
Development Activity40
Maintenance8
Community56
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
78/100Good
Architecture82
Code Quality85
Innovation75
Learning Curve70

indexmap is a pure-Rust hash table implementation that keeps entries in insertion order while still offering hash-map-speed lookups by key, and additionally lets you look up entries by their numerical position. Internally it pairs a raw hash table of key-value indices with a dense vector of the actual key-value pairs, built on hashbrown (the same table implementation backing Rust’s standard HashMap).

Because iteration runs over the dense, contiguous vector rather than scattered hash-table slots, indexmap is both fast to iterate and predictable to serialize or diff — a property plain HashMap doesn’t offer. It’s one of the most widely depended-upon crates in the Rust ecosystem (over a billion downloads), used anywhere insertion order matters: config/serialization crates, rustc itself, and general application code that wants map semantics without giving up ordering guarantees.

What You Get

  • IndexMap<K, V> and IndexSet<T> types with familiar map/set APIs plus indexed access (.get_index(), .get_index_of())
  • Insertion-order iteration that stays stable unless you call an order-changing removal method
  • A choice between .swap_remove() (fast, breaks order) and .shift_remove() (preserves relative order, O(n))
  • Optional integrations via feature flags: serde, rayon (parallel iterators), arbitrary, quickcheck, borsh, and sval
  • no_std support for embedded/constrained environments

Common Use Cases

  • Configuration or manifest data structures where output order should match the order keys were declared
  • Deduplicating a sequence while retaining first-seen order, using IndexSet
  • Data pipelines that need both fast key lookup and stable positional/index access into the same collection
  • Compiler and tooling internals (e.g. rustc) where deterministic iteration order matters for reproducible output

Under The Hood

Architecture The crate’s core lives in src/map.rs (~1,890 lines) and src/set.rs (~1,480 lines), each wrapping a shared inner structure (src/inner.rs) that pairs a raw hash table of key-value indices with a dense Vec of the actual entries — lookups hash the key to find its index, then index straight into the vector, giving both hash-map-speed access and vector-speed iteration. src/lib.rs (284 lines) wires up feature-gated modules for serde, rayon, arbitrary, borsh, and sval integrations. Tech Stack Built directly on hashbrown for the underlying SIMD-accelerated table (the same crate Rust’s std HashMap uses), with equivalent for flexible key-borrowing lookups; all other integrations (serde, rayon, quickcheck, borsh, sval) are optional via Cargo feature flags, keeping the default dependency footprint minimal. Code Quality The crate carries a substantial tests/ suite (tests.rs, quick.rs for property-based testing via quickcheck, plus equivalent_trait.rs) alongside separate test-nostd and test-serde sub-crates that validate feature combinations in isolation — a level of cross-feature test isolation uncommon in most libraries. API Design The public API deliberately mirrors std::collections::HashMap/HashSet method-for-method so it’s usable as a near drop-in replacement, while layering on indexed-access methods (get_index, get_index_of) and an explicit choice between swap_remove (fast, reorders) and shift_remove (preserves order) so callers make an informed trade-off rather than being surprised by reordering.

Used by 16 apps in this directory

Dart
74%
AGPL 3.0

AppFlowy

Productivity · Project Management · Collaboration

75,729

The open-source AI workspace that puts your data, your rules — with local LLMs, CRDT collaboration, and full self-hosting built in.

View details
66
Repo Health
81
Technical
66
Dependency
Built with
Dart74%
Rust24%
Updated 1 weeks ago
TypeScript
55%
Other

Cap

Team Chat · Video Conferencing

20,986

Open source Loom alternative with GPU-accelerated recording, instant share links, AI summaries, and full self-hosting via Docker Compose.

View details
89
Repo Health
81
Technical
65
Dependency
Built with
TypeScript55%
Rust40%
Updated yesterday
Rust
72%
Other

iii

Developer Tools · Devops

18,604

Compose, extend, and observe every backend service in real time using three primitives: Workers, Functions, and Triggers.

View details
86
Repo Health
85
Technical
69
Dependency
Built with
Rust72%
TypeScript17%
Updated yesterday
Rust
96%
Apache 2.0

InfluxDB

Databases · Analytics

31,705

Open-source time-series database built for real-time ingest, fast SQL queries, and embedded Python automation — powered by Apache Arrow and Parquet.

View details
86
Repo Health
76
Technical
72
Dependency
Built with
Rust96%
Updated yesterday
C++
49%
BSD 2

Ladybird

Browser

65,734

A truly independent web browser built from scratch — no Chromium, no WebKit, no Gecko.

View details
75
Repo Health
82
Technical
82
Dependency
Built with
C++49%
HTML22%
Rust14%
Updated today
TypeScript
69%
Apache 2.0

Laminar

AI Development · Monitoring

3,180

Open-source observability platform purpose-built for AI agents — trace, evaluate, debug, and monitor at scale with SQL access and real-time replay.

View details
85
Repo Health
76
Technical
70
Dependency
Built with
TypeScript69%
Rust29%
Updated yesterday
Rust
100%
Other

Meilisearch

Search

59,012

Lightning-fast hybrid search engine with AI-powered semantic and full-text retrieval for modern applications.

View details
90
Repo Health
88
Technical
68
Dependency
Built with
Rust100%
Updated 5 days ago
Rust
91%
Apache 2.0

Murr

Databases

107

A RocksDB-based NVMe/S3 cache purpose-built for AI inference workloads — a faster Redis replacement optimized for batch, low-latency, zero-copy reads and writes between data pipelines and inference apps.

View details
63
Repo Health
72
Technical
75
Dependency
Built with
Rust91%
Updated 1 months ago
Clojure
72%
MPL 2.0

Penpot

Design Tools

58,871

Open-source design platform with GPU-accelerated canvas, native design tokens, and MCP-powered AI workflows for teams that ship fast.

View details
91
Repo Health
83
Technical
75
Dependency
Built with
Clojure72%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search