2 unstable releases

0.2.0 Aug 12, 2024
0.1.0 Jul 5, 2024

#1314 in Data structures

Download history 23/week @ 2024-08-19 51/week @ 2024-08-26 43/week @ 2024-09-02 24/week @ 2024-09-09 45/week @ 2024-09-16 32/week @ 2024-09-23 26/week @ 2024-09-30 14/week @ 2024-10-07 7/week @ 2024-10-14 27/week @ 2024-11-18 24/week @ 2024-11-25 6/week @ 2024-12-02

57 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