sstadick / rust-lapper

Rust implementation of a fast, easy, interval tree library nim-lapper
https://docs.rs/rust-lapper
MIT License
55 stars 7 forks source link

An API to find the closest interval to a value #22

Open XVilka opened 9 months ago

XVilka commented 9 months ago

It would be great to extend Lapper's modus operandi to also perform the "fuzzy" search - instead of the exact match inside one of the intervals, allow to search for the closest interval when there is no exact match.

The API could be similar to find:

pub fn closest(&self, start: I, stop: I) -> IterFind<'_, I, T>ⓘ