indexmap
A hash table with consistent order and fast iteration.
2.14.0
1.4B downloads/mo
#12 most downloaded on crates.io
indexmap-rs/indexmap
What this package is like to depend on
Last release 4 months ago
09 Apr 2026
Ships fairly regularly
a new release about every 2 months
Nearly every release is documented
notes for 53 of 54 stable releases
1 version withdrawn
withdrawn after publishing
9 years old
55 releases · first in 2018
9 releases in the last 12 months
see the full history below
Release timeline
55 releases · Jan 2018 to Apr 2026Releases
latest 55-
2.14.009 Apr 2026Release notes
Open source →- MSRV: Rust 1.85.0 or later is now required.
- Updated the
hashbrowndependency to 0.17. - Made more
map::Slicemethodsconst:new_mut,first_mut,last_mut,split_at_mut,split_at_mut_checked,split_first_mut,split_last_mut
-
2.13.102 Apr 2026Release notes
Open source →- Made some
Slicemethodsconst:map::Slice::{first,last,split_at,split_at_checked,split_first,split_last}set::Slice::{first,last,split_at,split_at_checked,split_first,split_last}
- Made some
-
2.13.007 Jan 2026Release notes
Open source →- Implemented
CloneforIntoKeysandIntoValues. - Added
map::Slice::split_at_checkedandsplit_at_mut_checked. - Added
set::Slice::split_at_checked.
- Implemented
-
2.12.120 Nov 2025 -
2.12.017 Oct 2025Release notes
Open source →- MSRV: Rust 1.82.0 or later is now required.
- Updated the
hashbrowndependency to 0.16 alone. - Error types now implement
core::error::Error. - Added
pop_ifmethods toIndexMapandIndexSet, similar to the method forVecadded in Rust 1.86.
-
2.11.418 Sep 2025 -
2.11.315 Sep 2025 -
2.11.215 Sep 2025Release notes
Open source →- Switched the "serde" feature to depend on
serde_core, improving build parallelism in cases where other dependents have enabled "serde/derive".
- Switched the "serde" feature to depend on
-
2.11.109 Sep 2025Release notes
Open source →- Added a
get_key_value_mutmethod toIndexMap. - Removed the unnecessary
Ordbound oninsert_sorted_bymethods.
- Added a
-
2.11.022 Aug 2025Release notes
Open source →- Added
insert_sorted_byandinsert_sorted_by_keymethods toIndexMap,IndexSet, andVacantEntry, like customizable versions ofinsert_sorted. - Added
is_sorted,is_sorted_by, andis_sorted_by_keymethods toIndexMapandIndexSet, as well as theirSlicecounterparts. - Added
sort_by_keyandsort_unstable_by_keymethods toIndexMapandIndexSet, as well as parallel counterparts. - Added
replace_indexmethods toIndexMap,IndexSet, andVacantEntryto replace the key (or set value) at a given index. - Added optional
svalserialization support.
- Added
-
2.10.026 Jun 2025Release notes
Open source →- Added
extract_ifmethods toIndexMapandIndexSet, similar to the methods forHashMapandHashSetwith ranges likeVec::extract_if. - Added more
#[track_caller]annotations to functions that may panic.
- Added
-
2.9.004 Apr 2025Release notes
Open source →- Added a
get_disjoint_mutmethod toIndexMap, matching Rust 1.86'sHashMapmethod. - Added a
get_disjoint_indices_mutmethod toIndexMapandmap::Slice, matching Rust 1.86'sget_disjoint_mutmethod on slices. - Deprecated the
borshfeature in favor of their ownindexmapfeature, solving a cyclic dependency that occurred viaborsh-derive.
- Added a
-
2.8.010 Mar 2025Release notes
Open source →- Added
indexmap_with_default!andindexset_with_default!to be used with alternative hashers, especially when using the crate withoutstd. - Implemented
PartialEqbetween eachSliceand[]/arrays. - Removed the internal
rustc-rayonfeature and dependency.
- Added
-
2.7.120 Jan 2025Release notes
Open source →- Added
#[track_caller]to functions that may panic. - Improved memory reservation for
insert_entry.
- Added
-
2.7.001 Dec 2024Release notes
Open source →- Added methods
Entry::insert_entryandVacantEntry::insert_entry, returning anOccupiedEntryafter insertion.
- Added methods
-
2.6.001 Oct 2024Release notes
Open source →- Implemented
Cloneformap::IntoIterandset::IntoIter. - Updated the
hashbrowndependency to version 0.15.
- Implemented
-
2.5.030 Aug 2024Release notes
Open source →- Added an
insert_beforemethod toIndexMapandIndexSet, as an alternative toshift_insertwith different behavior on existing entries. - Added
first_entryandlast_entrymethods toIndexMap. - Added
Fromimplementations betweenIndexedEntryandOccupiedEntry.
- Added an
-
2.4.013 Aug 2024Release notes
Open source →- Added methods
IndexMap::appendandIndexSet::append, moving all items from one map or set into another, and leaving the original capacity for reuse.
- Added methods
-
2.3.031 Jul 2024Release notes
Open source →- Added trait
MutableEntryKeyfor opt-in mutable access to map entry keys. - Added method
MutableKeys::iter_mut2for opt-in mutable iteration of map keys and values.
- Added trait
-
2.2.623 Mar 2024 -
2.2.529 Feb 2024 -
2.2.429 Feb 2024Release notes
Open source →- Added an
insert_sortedmethod onIndexMap,IndexSet, andVacantEntry. - Avoid hashing for lookups in single-entry maps.
- Limit preallocated memory in
serdedeserializers.
- Added an
-
2.2.311 Feb 2024Release notes
Open source →- Added
move_indexandswap_indicesmethods toIndexedEntry,OccupiedEntry, andRawOccupiedEntryMut, functioning like the existing methods onIndexMap. - Added
shift_insertmethods onVacantEntryandRawVacantEntryMut, as well asshift_insert_hashed_nocheckon the latter, to insert the new entry at a particular index. - Added
shift_insertmethods onIndexMapandIndexSetto insert a new entry at a particular index, or else move an existing entry there.
- Added
-
2.2.231 Jan 2024Release notes
Open source →- Added indexing methods to raw entries:
RawEntryBuilder::from_hash_full,RawEntryBuilder::index_from_hash, andRawEntryMut::index.
- Added indexing methods to raw entries:
-
2.2.129 Jan 2024Release notes
Open source →- Corrected the signature of
RawOccupiedEntryMut::into_key(self) -> &'a mut K, This a breaking change from 2.2.0, but that version was published for less than a day and has now been yanked.
- Corrected the signature of
-
2.2.028 Jan 2024 withdrawnRelease notes
Open source →-
The new
IndexMap::get_index_entrymethod finds an entry by its index for in-place manipulation. -
The
Keysiterator now implementsIndex<usize>for quick access to the entry's key, compared to indexing the map to get the value. -
The new
IndexMap::spliceandIndexSet::splicemethods will drain the given range as an iterator, and then replace that range with entries from an input iterator. -
The new trait
RawEntryApiV1offers opt-in access to a raw entry API forIndexMap, corresponding to the unstable API onHashSetas of Rust 1.75. -
Many
IndexMapandIndexSetmethods have relaxed their type constraints, e.g. removingK: Hashon methods that don't actually need to hash. -
Removal methods
remove,remove_entry, andtakeare now deprecated in favor of theirshift_orswap_prefixed variants, which are more explicit about their effect on the index and order of remaining items. The deprecated methods will remain to guide drop-in replacements fromHashMapandHashSettoward the prefixed methods.
-
-
2.1.031 Oct 2023Release notes
Open source →-
Empty slices can now be created with
map::Slice::{new, new_mut}andset::Slice::new. In addition,Slice::new,len, andis_emptyare nowconstfunctions on both types. -
IndexMap,IndexSet, and their respectiveSlices all have binary search methods for sorted data: mapbinary_search_keysand setbinary_searchfor plain comparison,binary_search_byfor custom comparators,binary_search_by_keyfor key extraction, andpartition_pointfor boolean conditions.
-
-
2.0.229 Sep 2023Release notes
Open source →- The
hashbrowndependency has been updated to version 0.14.1 to complete the support for Rust 1.63.
- The
-
2.0.127 Sep 2023Release notes
Open source →- MSRV: Rust 1.63.0 is now supported as well, pending publication of
hashbrown's relaxed MSRV (or use cargo--ignore-rust-version).
- MSRV: Rust 1.63.0 is now supported as well, pending publication of
-
2.0.023 Jun 2023Release notes
Open source →-
MSRV: Rust 1.64.0 or later is now required.
-
The
"std"feature is no longer auto-detected. It is included in the default feature set, or else can be enabled like any other Cargo feature. -
The
"serde-1"feature has been removed, leaving just the optional"serde"dependency to be enabled like a feature itself. -
IndexMap::get_index_mutnow returnsOption<(&K, &mut V)>, changing the key part from&mut Kto&K. There is also a new alternativeMutableKeys::get_index_mut2to access the former behavior. -
The new
map::Slice<K, V>andset::Slice<T>offer a linear view of maps and sets, behaving a lot like normal[(K, V)]and[T]slices. Notably, comparison traits likeEqonly consider items in order, rather than hash lookups, and slices even implementHash. -
IndexMapandIndexSetnow havesort_by_cached_keyandpar_sort_by_cached_keymethods which perform stable sorts in place using a key extraction function. -
IndexMapandIndexSetnow havereserve_exact,try_reserve, andtry_reserve_exactmethods that correspond to the same methods onVec. However, exactness only applies to the direct capacity for items, while the raw hash table still follows its own rules for capacity and load factor. -
The
Equivalenttrait is now re-exported from theequivalentcrate, intended as a common base to allow types to work with multiple map types. -
The
hashbrowndependency has been updated to version 0.14. -
The
serde_seqmodule has been moved from the crate root to below themapmodule.
-
-
1.9.324 Mar 2023 -
1.9.217 Nov 2022Release notes
Open source →IndexMapandIndexSetboth implementarbitrary::Arbitrary<'_>andquickcheck::Arbitraryif those optional dependency features are enabled.
-
1.9.121 Jun 2022Release notes
Open source →- The MSRV now allows Rust 1.56.0 as well. However, currently
hashbrown0.12.1 requires 1.56.1, so users on 1.56.0 should downgrade that to 0.12.0 until there is a later published version relaxing its requirement.
- The MSRV now allows Rust 1.56.0 as well. However, currently
-
1.9.017 Jun 2022Release notes
Open source →-
MSRV: Rust 1.56.1 or later is now required.
-
The
hashbrowndependency has been updated to version 0.12. -
IterMutandValuesMutnow implementDebug. -
The new
IndexMap::shrink_toandIndexSet::shrink_tomethods shrink the capacity with a lower bound. -
The new
IndexMap::move_indexandIndexSet::move_indexmethods change the position of an item from one index to another, shifting the items between to accommodate the move.
-
-
1.8.228 May 2022 -
1.8.129 Mar 2022Release notes
Open source →- The new
IndexSet::replace_fullwill return the index of the item along with the replaced value, if any, by @zakcutner in PR 222.
- The new
-
1.8.007 Jan 2022Release notes
Open source →-
The new
IndexMap::into_keysandIndexMap::into_valueswill consume the map into keys or values, respectively, matching Rust 1.54'sHashMapmethods, by @taiki-e in PR 195. -
More of the iterator types implement
Debug,ExactSizeIterator, andFusedIterator, by @cuviper in PR 196. -
IndexMapandIndexSetnow implement rayon'sParallelDrainRange, by @cuviper in PR 197. -
IndexMap::with_hasherandIndexSet::with_hasherare nowconstfunctions, allowing static maps and sets, by @mwillsey in PR 203. -
IndexMapandIndexSetnow implementFromfor arrays, matching Rust 1.56's implementation forHashMap, by @rouge8 in PR 205. -
IndexMapandIndexSetnow have methodssort_unstable_keys,sort_unstable_by,sorted_unstable_by, andpar_*equivalents, which sort in-place without preserving the order of equal items, by @bhgomes in PR 211.
-
-
1.7.029 Jun 2021Release notes
Open source →-
MSRV: Rust 1.49 or later is now required.
-
The
hashbrowndependency has been updated to version 0.11.
-
-
1.6.205 Mar 2021 -
1.6.115 Dec 2020Release notes
Open source →-
The new
serde_seqmodule implementsIndexMapserialization as a sequence to ensure order is preserved, by @cuviper in PR 158. -
New methods on maps and sets work like the
Vec/slice methods by the same name:truncate,split_off,first,first_mut,last,last_mut, andswap_indices, by @cuviper in PR 160.
-
-
1.6.005 Sep 2020Release notes
Open source →-
MSRV: Rust 1.36 or later is now required.
-
The
hashbrowndependency has been updated to version 0.9.
-
-
1.5.201 Sep 2020Release notes
Open source →- The new "std" feature will force the use of
stdfor users that explicitly want the defaultS = RandomState, bypassing the autodetection added in 1.3.0, by @cuviper in PR 145.
- The new "std" feature will force the use of
-
1.5.108 Aug 2020 -
1.5.018 Jul 2020Release notes
Open source →-
MSRV: Rust 1.32 or later is now required.
-
The inner hash table is now based on
hashbrownby @cuviper in PR 131. This also completes the methodreserveand addsshrink_to_fit. -
Add new methods
get_key_value,remove_entry,swap_remove_entry, andshift_remove_entry, by @cuviper in PR 136 -
Clone::clone_fromreuses allocations by @cuviper in PR 125 -
Add new method
reverseby @linclelinkpart5 in PR 128
-
-
1.4.001 Jun 2020Release notes
Open source →-
Add new method
get_index_ofby @Thermatrix in PR 115 and 120 -
Fix build script rebuild-if-changed configuration to use "build.rs"; fixes issue 123. Fix by @cuviper.
-
Dev-dependencies (rand and quickcheck) have been updated. The crate's tests now run using Rust 1.32 or later (MSRV for building the crate has not changed). by @kjeremy and @bluss
-
-
1.3.205 Feb 2020 -
1.3.115 Jan 2020 -
1.3.018 Oct 2019Release notes
Open source →- The deprecation messages in the previous version have been removed. (The methods have not otherwise changed.) Docs for removal methods have been improved.
- From Rust 1.36, this crate supports being built without std, requiring
allocinstead. This is enabled automatically when it is detected thatstdis not available. There is no crate feature to enable/disable to trigger this. The new build-depautocfgenables this.
-
1.2.008 Sep 2019Release notes
Open source →-
Plain
.remove()now has a deprecation message, it informs the user about picking one of the removal functionsswap_removeandshift_removewhich have different performance and order semantics. Plain.remove()will not be removed, the warning message and method will remain until further. -
Add new method
shift_removefor order preserving removal on the map, andshift_takefor the corresponding operation on the set. -
Add methods
swap_remove,swap_remove_entrytoEntry. -
Fix indexset/indexmap to support full paths, like
indexmap::indexmap!() -
Internal improvements: fix warnings, deprecations and style lints
-
-
1.1.020 Aug 2019Release notes
Open source →-
Added optional feature
"rayon"that adds parallel iterator support toIndexMapandIndexSetusing Rayon. This includes all the regular iterators in parallel versions, and parallel sort. -
Implemented
Cloneformap::{Iter, Keys, Values}andset::{Difference, Intersection, Iter, SymmetricDifference, Union} -
Implemented
Debugformap::{Entry, IntoIter, Iter, Keys, Values}andset::{Difference, Intersection, IntoIter, Iter, SymmetricDifference, Union} -
Serde trait
IntoDeserializerare implemented forIndexMapandIndexSet. -
Minimum Rust version requirement increased to Rust 1.30 for development builds.
-
-
1.0.222 Oct 2018Release notes
Open source →-
The new methods
IndexMap::insert_fullandIndexSet::insert_fullare both likeinsertwith the index included in the return value. -
The new method
Entry::and_modifycan be used to modify occupied entries, matching the new methods ofstdmaps in Rust 1.26. -
The new method
Entry::or_defaultinserts a default value in unoccupied entries, matching the new methods ofstdmaps in Rust 1.28.
-
-
1.0.124 Mar 2018 -
1.0.011 Mar 2018Release notes
Open source →- This is the 1.0 release for
indexmap! (the crate and datastructure formerly known as “ordermap”) OccupiedEntry::insertchanged its signature, to use&mut selffor the method receiver, matching the equivalent method for a standardHashMap. Thanks to @dtolnay for finding this bug.- The deprecated old names from ordermap were removed:
OrderMap,OrderSet,ordermap!{},orderset!{}. Use the newIndexMapetc names instead.
- This is the 1.0 release for
-
0.4.114 Feb 2018Release notes
Open source →- Renamed crate to
indexmap; theordermapcrate is now deprecated and the typesOrderMap/Setnow have a deprecation notice.
- Renamed crate to
-
0.0.130 Jan 2018Nothing published for this version