rangemap
Map and set data structures whose keys are stored as ranges. Contiguous and overlapping ranges that map to the same value are coalesced into a single range.
1.8.0
31M downloads/mo
#1629 most downloaded on crates.io
jeffparsons/rangemap
What this package is like to depend on
Last release 9 days ago
14 Aug 2026
Release timing varies
gaps range from 2 weeks to 1.4 years
Most releases are documented
notes for 24 of 30 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
30 releases · first in 2019
3 releases in the last 12 months
see the full history below
Release timeline
30 releases · Feb 2019 to Aug 2026Releases
latest 30-
1.8.014 Aug 2026Release notes
Open source →-
Features:
- Add support for using
ordered_float::NotNan<f32>andordered_float::NotNan<f64>as keys ofRangeInclusiveMapandRangeInclusiveSet, gated behind theordered-float5feature. The successor of a float is taken to be the next representable float, so ranges that are one ULP (unit in the last place) apart will be coalesced. Thanks to Qix- for implementing this!
- Add support for using
-
Fixes:
- Fix building without the Rust standard library when the
serde1feature is enabled. Enablingserde1also enabled serde's default features, including itsstdfeature, so this has never actually worked.
- Fix building without the Rust standard library when the
-
Changes:
- Switch to the version 2 feature resolver, so that features enabled by dev-dependencies no longer leak into normal builds.
-
-
1.7.119 Dec 2025Release notes
Open source →- Fixes:
- Fix
PartialEq,PartialOrd, andOrdimplementations forRangeInclusiveMap(andRangeInclusiveSet). These previously only compared the starts of ranges instead of the entire range. (Same class of bug that was fixed forRangeMapin v1.3.1.)
- Fix
- Fixes:
-
1.7.015 Nov 2025Release notes
Open source →-
Features:
- Relax
Eqbounds toPartialEq. (We don't actually need to demand reflexivity.)
- Relax
-
Changes:
- Bump minimum supported Rust version to 1.81.0 (released 2024-09-05).
-
-
1.6.026 Jul 2025Release notes
Open source →- Features:
- Add quickcheck support, gated behind the
quickcheckfeature. - Improve performance of
RangeMap::gapsby efficiently seeking to the start of the query range.
- Add quickcheck support, gated behind the
- Features:
-
1.5.127 Feb 2024Release notes
Open source →- Fixes:
- Relax bounds on
Defaultimplementation for all map and set types. RequiringK: DefaultandV: Defaultwas accidentally introduced in v1.5.0.
- Relax bounds on
- Fixes:
-
1.5.009 Feb 2024Release notes
Open source →Huge thanks to xfbs, who did pretty much all the work you see in the changelog below! 💖
-
Features:
- Add
unionandintersectionmethods to iterate over the union or intersection of two sets. - Add
first_range_valueandlast_range_valuemethods to map types andfirstandlastmethods to set types. - Add literal macros for all collection types — e.g.
range_set![0..100, 200..300, 400..500]. - Implement
DefaultandHashfor all collection types. - Implement
DoubleEndedIteratorfor all iterators. - Implement
From<[_; N]>(e.g.From<[Range<T>; N]> for RangeSet<T>) for all collections. (Previously you could build a collection from an iterator, but not directly from an array.) - Implement
BitOrandBitAndfor set types. (Convenience wrapper around theunionandintersectionmethods mentioned above.) - Accept any
R: Borrow<Range<K>>as argument tooverlappingmethods, allowing it to take ranges by value.
- Add
-
Changes:
- Bump minimum supported Rust version to 1.66.0 (released 2022-12-15). This is to gain access to
BTreeMap::first_key_valueandBTreeMap::last_key_value, and for compatibility with new versions of some of rangemap's test dependencies.
- Bump minimum supported Rust version to 1.66.0 (released 2022-12-15). This is to gain access to
-
Internal:
- New benchmarks and improved test coverage.
-
-
1.4.018 Sep 2023Release notes
Open source →- Changes:
- Bump minimum supported Rust version to 1.61.0 (released 2022-05-19). This is for compatibility with new versions of some of rangemap's test dependencies.
- Changes:
-
1.3.118 Sep 2023Release notes
Open source →- Fixes:
- Fix
PartialEq,PartialOrd, andOrdimplementations forRangeMap(andRangeSet). These previously only compared the starts of ranges instead of the entire range. Thanks to https://github.com/hecrj for finding and fixing this!
- Fix
- Changes:
- Minimum supported Rust version for running this crate's tests has increased to 1.61.0 due to a corresponding MSRV bump in a test dependency. This is causing CI builds to fail against rustc 1.56.1, but should not affect consumers of the crate. The next minor release (1.4.0) will bump the minimum supported Rust version of rangemap itself.
- Fixes:
-
1.3.003 Jan 2023Release notes
Open source →- Features:
- Add
overlappingmethod to all collection types, which returns an iterator over all stored entries that completely or partially overlap a given range. - Add
overlapsconvenience method to all collection types, which returns whether any stored range completely or partially overlaps a given range. - Credit to Rua for the original implementation of these new methods. (Unfortunately I couldn't use their code directly because I made other incompatible changes.) Thanks also to rumpuslabs for their engagement.
- Add
- Features:
-
1.2.026 Dec 2022Release notes
Open source →- Features:
- Add
clear,len, andis_emptymethods for all map and set types.
- Add
- Fixes:
- Make
const_fnfeature work again. (Previous release accidentally broke the const versions ofRangeMap::newandRangeSet::new.)
- Make
- Features:
-
1.1.011 Nov 2022Release notes
Open source →- Features:
- Implement
PartialEq,Eq,PartialOrd, andOrdfor all map and set types. - Make
newfunctions for all map and set typesconstwhenconst_fnfeature is enabled.
- Implement
- Changes:
- Bump minimum supported Rust version to 1.56.1. (Released a year ago.) This is for compatibility with new versions of some of rangemap's development dependencies.
- Features:
-
1.0.311 Jun 2022Release notes
Open source →- Fixes:
- Fix
Gapsiterator forRangeMapyielding an empty gap for an empty outer range. Simplified gaps logic and expanded fuzz testing to better cover this and similar cases.
- Fix
- Fixes:
-
1.0.217 May 2022Release notes
Open source →- Fixes:
- Fix empty gaps returned by
Gapsiterator forRangeInclusiveMap. Added fuzz tests forGapsiterators.
- Fix empty gaps returned by
- Fixes:
-
1.0.129 Jan 2022Release notes
Open source →- Fixes:
- Fix empty gaps returned by
Gapsiterator forRangeMap, and incorrect gaps returned byGapsiterator forRangeInclusiveMap.
- Fix empty gaps returned by
- Fixes:
-
1.0.027 Jan 2022 -
0.1.1415 Nov 2021Release notes
Open source →- Features:
- Expose nameable types for iterators:
Iterator,IntoIterator,Gaps(for each collection type).
- Expose nameable types for iterators:
- Changes:
- Document overflow behaviour required by implementors of
StepLiteandStepFns.
- Document overflow behaviour required by implementors of
- Features:
-
0.1.1325 Aug 2021 -
0.1.1223 Aug 2021Release notes
Open source →- Features:
- Implement more traits for all map and set types:
IntoIter,FromIter, andExtend.
- Implement more traits for all map and set types:
- Changes:
- Bump minimum supported Rust version to 1.46.
- Features:
-
0.1.1130 Jun 2021Release notes
Open source →- Features:
- Support
no_stdenvironments.
- Support
- Changes:
- Update all dev-dependencies to latest versions.
- Features:
-
0.1.1022 Feb 2021Release notes
Open source →- Fixes:
- Fix performance regression introduced in v0.1.9, which made inserts extremely slow for large maps.
- Fixes:
-
0.1.922 Feb 2021Release notes
Open source →- Fixes:
- Fix coalescing of contiguous ranges. In some cases
RangeMapandRangeInclusiveMapwould leave two separate contiguous ranges with the same value instead of combining them into one.
- Fix coalescing of contiguous ranges. In some cases
- Fixes:
-
0.1.822 Nov 2020 -
0.1.707 Sep 2020Release notes
Open source →- Features:
- Add
gapsmethod to all map and set types for iterating over sub-ranges of a given outer range that are not covered by any stored range.
- Add
- Features:
-
0.1.614 Jul 2020Release notes
Open source →- Features:
- Add
RangeInclusiveMapandRangeInclusiveSettypes for storing closed ranges.
- Add
- Features:
-
0.1.523 Jun 2020Nothing published for this version
-
0.1.407 Jan 2020Nothing published for this version
-
0.1.325 Feb 2019Nothing published for this version
-
0.1.225 Feb 2019Nothing published for this version
-
0.1.115 Feb 2019Nothing published for this version
-
0.1.015 Feb 2019Nothing published for this version