pub struct IntervalTree<'ob> {
pub tree: IntervalTree<Slot<Gc<ObjectType<'ob>>>>,
}
Fields§
§tree: IntervalTree<Slot<Gc<ObjectType<'ob>>>>
Implementations§
Source§impl<'ob> IntervalTree<'ob>
impl<'ob> IntervalTree<'ob>
pub fn new() -> Self
Sourcepub fn insert(
&mut self,
start: usize,
end: usize,
val: Slot<Gc<ObjectType<'ob>>>,
cx: &'ob Context<'_>,
)
pub fn insert( &mut self, start: usize, end: usize, val: Slot<Gc<ObjectType<'ob>>>, cx: &'ob Context<'_>, )
Inserts a new interval with the specified range and value into the interval tree.
If the interval overlaps with existing intervals, their properties will be merged
using add_properties
. The resulting object will be stored in the tree.
pub fn set_properties( &mut self, start: usize, end: usize, properties: Gc<ObjectType<'ob>>, )
pub fn find(&self, position: usize) -> Option<&Node<Slot<Gc<ObjectType<'ob>>>>>
Sourcepub fn delete(
&mut self,
start: usize,
end: usize,
list_of_props: Gc<ObjectType<'ob>>,
) -> Result<()>
pub fn delete( &mut self, start: usize, end: usize, list_of_props: Gc<ObjectType<'ob>>, ) -> Result<()>
Deletes properties from intervals within [start..end) that match properties in list_of_props
.
This function iterates through nodes in the specified range and removes any properties
that are equal (using eq
) to those in list_of_props
.
§Arguments
start
- Start position of the range (inclusive)end
- End position of the range (exclusive)list_of_props
- The properties to delete (as an Object containing a list of properties)cx
- The context used for equality testing
pub fn clean(&mut self)
pub(crate) fn iter<'a>( &'a self, start: usize, end: usize, ) -> IntervalIntersections<'ob, 'a> ⓘ
pub(crate) fn iter_reverse<'a>( &'a self, start: usize, end: usize, ) -> ReverseIntervalIntersections<'ob, 'a> ⓘ
Trait Implementations§
Source§impl<'ob> Debug for IntervalTree<'ob>
impl<'ob> Debug for IntervalTree<'ob>
Source§impl<'new> IntoRoot<IntervalTree<'new>> for IntervalTree<'_>
impl<'new> IntoRoot<IntervalTree<'new>> for IntervalTree<'_>
unsafe fn into_root(self) -> IntervalTree<'new>
Source§impl<'new> WithLifetime<'new> for IntervalTree<'_>
impl<'new> WithLifetime<'new> for IntervalTree<'_>
type Out = IntervalTree<'new>
unsafe fn with_lifetime(self) -> IntervalTree<'new>
impl Send for IntervalTree<'_>
Auto Trait Implementations§
impl<'ob> Freeze for IntervalTree<'ob>
impl<'ob> !RefUnwindSafe for IntervalTree<'ob>
impl<'ob> !Sync for IntervalTree<'ob>
impl<'ob> Unpin for IntervalTree<'ob>
impl<'ob> !UnwindSafe for IntervalTree<'ob>
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