1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! `interval_map` is a thread-safe map based on interval tree.
//!
//! It fully implements the insertion and deletion functionality of a red-black tree,
//! ensuring that each modification operation requires at most O(logN) time complexity.
//!
//! To safely and efficiently handle insertion and deletion operations in Rust,
//! `interval_map` innovatively uses arrays to simulate pointers for managing the parent-child
//! references in the red-black tree. This approach also ensures that interval_map has the
//! `Send` and `Unpin` traits, allowing it to be safely transferred between threads and
//! to maintain a fixed memory location during asynchronous operations.
//!
//! # Example
//!
//! ```rust
//! use rb_interval_map::{Interval, IntervalMap};
//!
//! let mut map = IntervalMap::new();
//! let int = Interval::new(1, 2);
//! map.insert(int.clone(), 123456);
//! assert_eq!(map.get(&int), Some(&123456));
//! ```
//!
pub use ;
pub use Interval;
pub use IntervalMap;
pub use ;