Struct IntervalTree

Source
pub struct IntervalTree<'ob> {
    pub tree: IntervalTree<Slot<Gc<ObjectType<'ob>>>>,
}

Fields§

§tree: IntervalTree<Slot<Gc<ObjectType<'ob>>>>

Implementations§

Source§

impl<'ob> IntervalTree<'ob>

Source

pub fn new() -> Self

Source

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.

Source

pub fn set_properties( &mut self, start: usize, end: usize, properties: Gc<ObjectType<'ob>>, )

Source

pub fn find(&self, position: usize) -> Option<&Node<Slot<Gc<ObjectType<'ob>>>>>

Source

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
Source

pub fn clean(&mut self)

Source

pub(crate) fn iter<'a>( &'a self, start: usize, end: usize, ) -> IntervalIntersections<'ob, 'a>

Source

pub(crate) fn iter_reverse<'a>( &'a self, start: usize, end: usize, ) -> ReverseIntervalIntersections<'ob, 'a>

Trait Implementations§

Source§

impl<'ob> Debug for IntervalTree<'ob>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'new> IntoRoot<IntervalTree<'new>> for IntervalTree<'_>

Source§

unsafe fn into_root(self) -> IntervalTree<'new>

Source§

impl Trace for IntervalTree<'_>

Source§

fn trace(&self, state: &mut GcState)

Source§

impl<'new> WithLifetime<'new> for IntervalTree<'_>

Source§

type Out = IntervalTree<'new>

Source§

unsafe fn with_lifetime(self) -> IntervalTree<'new>

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V