2 unstable releases

0.2.0 Aug 12, 2024
0.1.0 Jul 5, 2024

#485 in Algorithms

Download history 92/week @ 2024-06-30 18/week @ 2024-07-07 2/week @ 2024-07-14 143/week @ 2024-08-11 30/week @ 2024-08-18 44/week @ 2024-08-25 47/week @ 2024-09-01 28/week @ 2024-09-08 45/week @ 2024-09-15 29/week @ 2024-09-22 29/week @ 2024-09-29

133 downloads per month
Used in 2 crates

MPL-2.0 license

31KB
743 lines

Range List

rangelist is a Rust library that implements sets of element as ranges of elements (intervals), providing efficient storage and operations for sets with contiguous data. Users can use the provided RangeList type or use the provided traits and iterators to use the library with their own types.

Getting Started

Install the library using cargo:

cargo install rangelist

Read the documentation for more information about how to use the library.

License

This project is licensed under the MPL-2.0 License. See the LICENSE file for details.


lib.rs:

A library for working with set of values represented as inclusive ranges.

This library provides a RangeList struct that can be used to represent sets of values as a collection of inclusive ranges. The ranges are stored in a deduplicated sorted order.

Additionally, the library defines IntervalIterator trait to be implemented by types can provide an iterator of sorted inclusive ranges. Any combination of types that implement this trait can be used to perform standard set operations such as union and intersection.

Finally, the library provides DiffIter, IntersectIter, and UnionIter, which are lazy iterator combinators that can be used to perform set operations on two iterators of ordered ranges.

Dependencies

~505KB