pub struct IntervalTree<T: Clone + Eq + Hash> { /* private fields */ }Expand description
B-Tree based implementation of the interval index.
Implementations§
Source§impl<T: Clone + Eq + Hash> IntervalTree<T>
impl<T: Clone + Eq + Hash> IntervalTree<T>
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn get_mut(&mut self, low: u32, high: u32) -> Option<&mut HashSet<T>>
pub fn get_mut(&mut self, low: u32, high: u32) -> Option<&mut HashSet<T>>
Get a mutable reference to the values for an exact interval match. Required by the Entry API.
Sourcepub fn insert(&mut self, low: u32, high: u32, value: T)
pub fn insert(&mut self, low: u32, high: u32, value: T)
Insert a value for the given interval [low, high]
pub fn query(&self, q_low: u32, q_high: u32) -> Vec<(u32, u32, HashSet<T>)>
pub fn remove(&mut self, low: u32, high: u32, value: &T) -> bool
pub fn entry(&mut self, low: u32, high: u32) -> BTreeEntry<'_, T>
Sourcepub fn bulk_build_points(&mut self, items: Vec<(u32, HashSet<T>)>)
pub fn bulk_build_points(&mut self, items: Vec<(u32, HashSet<T>)>)
Bulk build optimization for a collection of point intervals [x,x].
Trait Implementations§
Source§impl<T: Clone + Clone + Eq + Hash> Clone for IntervalTree<T>
impl<T: Clone + Clone + Eq + Hash> Clone for IntervalTree<T>
Source§fn clone(&self) -> IntervalTree<T>
fn clone(&self) -> IntervalTree<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for IntervalTree<T>
impl<T> RefUnwindSafe for IntervalTree<T>where
T: RefUnwindSafe,
impl<T> Send for IntervalTree<T>where
T: Send,
impl<T> Sync for IntervalTree<T>where
T: Sync,
impl<T> Unpin for IntervalTree<T>
impl<T> UnsafeUnpin for IntervalTree<T>
impl<T> UnwindSafe for IntervalTree<T>where
T: RefUnwindSafe,
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more