[−][src]Struct intervaltree::IntervalTree
A simple and generic implementation of an immutable interval tree.
To build it, always use FromIterator
. This is not very optimized
as it takes O(log n)
stack (it uses recursion) but runs in O(n log n)
.
Implementations
impl<K: Ord, V> IntervalTree<K, V>
[src]
pub fn query(&self, range: Range<K>) -> QueryIter<K, V>
[src]
Queries the interval tree for all elements overlapping a given interval.
This runs in O(log n + m)
.
pub fn query_point(&self, point: K) -> QueryIter<K, V>
[src]
Queries the interval tree for all elements containing a given point.
This runs in O(log n + m)
.
pub fn iter(&self) -> TreeIter<K, V>
[src]
Returns an iterator over all elements in the tree (in no particular order).
pub fn iter_sorted<'a>(&'a self) -> impl Iterator<Item = &'a Element<K, V>>
[src]
Returns an iterator over all elements in the tree, sorted by Element.range.start
.
This is currently identical to IntervalTree::iter
because the internal structure
is already sorted this way, but may not be in the future.
Trait Implementations
impl<K: Clone, V: Clone> Clone for IntervalTree<K, V>
[src]
fn clone(&self) -> IntervalTree<K, V>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<K: Debug, V: Debug> Debug for IntervalTree<K, V>
[src]
impl<K: Ord + Clone, V, I: Into<Element<K, V>>> FromIterator<I> for IntervalTree<K, V>
[src]
fn from_iter<T: IntoIterator<Item = I>>(iter: T) -> Self
[src]
impl<K: Hash, V: Hash> Hash for IntervalTree<K, V>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a, K: 'a + Ord, V: 'a> IntoIterator for &'a IntervalTree<K, V>
[src]
type Item = &'a Element<K, V>
The type of the elements being iterated over.
type IntoIter = TreeIter<'a, K, V>
Which kind of iterator are we turning this into?
fn into_iter(self) -> TreeIter<'a, K, V>
[src]
impl<K, V> IntoIterator for IntervalTree<K, V>
[src]
type Item = Element<K, V>
The type of the elements being iterated over.
type IntoIter = TreeIntoIter<K, V>
Which kind of iterator are we turning this into?
fn into_iter(self) -> TreeIntoIter<K, V>
[src]
Auto Trait Implementations
impl<K, V> RefUnwindSafe for IntervalTree<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for IntervalTree<K, V> where
K: Send,
V: Send,
K: Send,
V: Send,
impl<K, V> Sync for IntervalTree<K, V> where
K: Sync,
V: Sync,
K: Sync,
V: Sync,
impl<K, V> Unpin for IntervalTree<K, V> where
K: Unpin,
V: Unpin,
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for IntervalTree<K, V> where
K: UnwindSafe,
V: UnwindSafe,
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,