pub struct IntervalTree { /* private fields */ }Expand description
An interval tree for efficient clip lookup.
Build the tree from a list of clip intervals using IntervalTree::build,
then query with query_point or query_range.
Implementations§
Source§impl IntervalTree
impl IntervalTree
Sourcepub fn build(intervals: Vec<ClipInterval>) -> Self
pub fn build(intervals: Vec<ClipInterval>) -> Self
Build an interval tree from a list of intervals.
The intervals are sorted by start position and augmented with max-end values for efficient querying.
Sourcepub fn query_point(&self, point: i64) -> Vec<ClipInterval>
pub fn query_point(&self, point: i64) -> Vec<ClipInterval>
Query all intervals that contain a specific point.
Sourcepub fn query_range(&self, start: i64, end: i64) -> Vec<ClipInterval>
pub fn query_range(&self, start: i64, end: i64) -> Vec<ClipInterval>
Query all intervals that overlap with a range.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IntervalTree
impl RefUnwindSafe for IntervalTree
impl Send for IntervalTree
impl Sync for IntervalTree
impl Unpin for IntervalTree
impl UnsafeUnpin for IntervalTree
impl UnwindSafe for IntervalTree
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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